File size: 432 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// @flow

import * as React from "react";

import Tab from "./Tab.react";

type Props = {|
  +children: React.ChildrenArray<React.Element<typeof Tab>>,
  +selectedTitle: string,
|};

function TabbedContainer(props: Props): React.Node {
  const tabs = React.Children.toArray(props.children);
  return tabs.filter(tab => tab.props.title === props.selectedTitle);
}

/** @component */
export default TabbedContainer;