React suggests to Transfer Props. Neat!
How can I transfert all but one?
render: function(){ return (<Cpnt {...this.propsButOne}><Subcpnt one={this.props.one} /></Cpnt>); }
You can use the following technique to consume some of the props and pass on the rest:
render() { var {one, ...other} = this.props; return ( <Cpnt {...other}> <Subcpnt one={one} /> </Cpnt> ); }
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With