@@ -4,35 +4,8 @@ import {omit} from 'ramda';
44import classnames from 'classnames' ;
55import RBNav from 'react-bootstrap/Nav' ;
66import RBTab from 'react-bootstrap/Tab' ;
7- import { isNil } from 'ramda' ;
87
9- const resolveChildProps = child => {
10- // This may need to change in the future if https://github.com/plotly/dash-renderer/issues/84 is addressed
11- if (
12- // disabled is a defaultProp (so it's always set)
13- // meaning that if it's not set on child.props, the actual
14- // props we want are lying a bit deeper - which means they
15- // are coming from Dash
16- isNil ( child . props . disabled ) &&
17- child . props . _dashprivate_layout &&
18- child . props . _dashprivate_layout . props
19- ) {
20- // props are coming from Dash
21- return child . props . _dashprivate_layout . props ;
22- } else {
23- // else props are coming from React (e.g. Demo.js, or Tabs.test.js)
24- return child . props ;
25- }
26- } ;
27-
28- const parseChildrenToArray = children => {
29- if ( children && ! Array . isArray ( children ) ) {
30- // if dcc.Tabs.children contains just one single element, it gets passed as an object
31- // instead of an array - so we put in in a array ourselves!
32- return [ children ] ;
33- }
34- return children ;
35- } ;
8+ import { parseChildrenToArray , resolveChildProps } from '../../private/util' ;
369
3710/**
3811 * Create Bootstrap styled tabs. Use the `active_tab` property to set, or get
0 commit comments