| 126 | }, [children]); |
| 127 | |
| 128 | const valueOrDefault = (): string | undefined => { |
| 129 | if (has('value', props)) { |
| 130 | return props.value; |
| 131 | } |
| 132 | const children = parseChildrenToArray(); |
| 133 | if (children && children.length && children[0].props.componentPath) { |
| 134 | const firstChildren: TabProps = window.dash_component_api.getLayout( |
| 135 | [...children[0].props.componentPath, 'props'] |
| 136 | ); |
| 137 | return firstChildren.value ?? 'tab-1'; |
| 138 | } |
| 139 | return 'tab-1'; |
| 140 | }; |
| 141 | |
| 142 | // Initialize value on mount if not set |
| 143 | useEffect(() => { |