Guest User

Untitled

a guest
Mar 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. renderChildren(funcs) {
  2. // debugger
  3. return (
  4. React.Children.map(this.props.children, (child) => {
  5. debugger // *** Need to access `this.state` from in here ***
  6. return React.cloneElement(child, {
  7. state: this.state, // *** Need access here too
  8. callbackFuncs: funcs
  9. })
  10. })
  11. )
  12. }
  13.  
  14. renderChildren(funcs) {
  15. React.Children.map(this.props.children, (child) => {
  16. return React.cloneElement(child, {
  17. state: this.state,
  18. callbackFuncs: funcs
  19. })
  20. })
  21. }
Add Comment
Please, Sign In to add comment