Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default tab not apper #158

Open
wildfrontend opened this issue Oct 8, 2020 · 0 comments
Open

default tab not apper #158

wildfrontend opened this issue Oct 8, 2020 · 0 comments

Comments

@wildfrontend
Copy link

innerState defaultValue set 0 to 1 is work


export const Tabs: TabsComponent = ({ state: outerState, children }) => {
  const innerState = useState(1)
  const elements = useConstant(() => ({ tabs: 0, panels: 0 }))
  const state = outerState || innerState

  return (
    <Elements.Provider value={elements}>
      <TabsState.Provider value={state}>{children}</TabsState.Provider>
    </Elements.Provider>
  )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant