Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- render() {
- const children = React.Children.map(this.props.children, (child, index) => {
- if (child.type === Panels) {
- return React.cloneElement(child, {
- activeIndex: this.state.activeIndex
- });
- } else if (child.type === List) {
- return React.cloneElement(child, {
- activeIndex: this.state.activeIndex,
- onActivateTab: activeIndex => {
- this.setState({ activeIndex });
- }
- });
- }
- return child;
- });
- return <Fragment>{children}</Fragment>;
- }
Add Comment
Please, Sign In to add comment