Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Component propOne={this.props.one} propTwo={this.props.two}>
- {this.props.children}
- </Component>
- <Component propOne={this.props.one} propTwo={this.props.two} {...this.props} >
- {this.props.children}
- </Component>
- const {propOne, propTwo, ...leftOver} = this.props;
- // `leftOver` contains everything except `propOne` and `propTwo`
- const {propOne, propTwo, children, ...props} = this.props;
- <Component propOne={propOne} propTwo={propTwo} {...props}>
- {children}
- </Component>
- function without(props, keys) {
- return Object.keys(props)
- .filter((key) => keys.indexOf(key) !== -1)
- .reduce((retVal, key) => {
- retVal[key] = props[key];
- }, {});
- }
- <Component propOne={this.props.one} propTwo={this.props.two} {...without(this.props, ['one', 'two'])} >
- {this.props.children}
- </Component>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement