Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- renderChildren(funcs) {
- // debugger
- return (
- React.Children.map(this.props.children, (child) => {
- debugger // *** Need to access `this.state` from in here ***
- return React.cloneElement(child, {
- state: this.state, // *** Need access here too
- callbackFuncs: funcs
- })
- })
- )
- }
- renderChildren(funcs) {
- React.Children.map(this.props.children, (child) => {
- return React.cloneElement(child, {
- state: this.state,
- callbackFuncs: funcs
- })
- })
- }
Add Comment
Please, Sign In to add comment