React suggests to Transfer Props. Neat!
How can I transfert all but one?
render: function(){
return (
If you have a lot of props you don't want in ...rest
e.g. defaultProps, it can be annoying to write all of them twice. Instead you can create it yourself with a simple loop over the current props like that:
let rest = {};
Object.keys(this.props).forEach((key, index) => {
if(!(key in MyComponent.defaultProps))
rest[key] = this.props[key];
});