Guest User

Untitled

a guest
May 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. render() {
  2. const children = React.Children.map(this.props.children, (child, index) => {
  3. if (child.type === Panels) {
  4. return React.cloneElement(child, {
  5. activeIndex: this.state.activeIndex
  6. });
  7. } else if (child.type === List) {
  8. return React.cloneElement(child, {
  9. activeIndex: this.state.activeIndex,
  10. onActivateTab: activeIndex => {
  11. this.setState({ activeIndex });
  12. }
  13. });
  14. }
  15. return child;
  16. });
  17.  
  18. return <Fragment>{children}</Fragment>;
  19. }
Add Comment
Please, Sign In to add comment