We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Tabs
destroyInactiveTabPane: true
useEffect(() => alert('onMount'), [])
If the component was destroyed when the tab is closed, the useEffect should fire every time the tab is opened.
useEffect
It only fires the first time the tab is opened
I tested with both the items prop and the children and got the same result. Also tried adding forceRender, but it doesn't do anything either.
items
forceRender
It does work if you set the destroyInactiveTabPane at the component level, but in my cases this would be highly undesired to destroy all the tabs!
destroyInactiveTabPane
The text was updated successfully, but these errors were encountered:
I looked at the source code, and the destroyInactiveTabPane set at the component level is applied to the tab level. https://github.com/react-component/tabs/blob/415ff34b8121e3353a11d8f640062fd966488603/src/TabPanelList/index.tsx#L35
Sorry, something went wrong.
so... seems like a bug then?
The Tab Docs have no reference of the prop on the pane, but it's in the types.
Seems like it was intended to be put in place, but wasn't
Successfully merging a pull request may close this issue.
Reproduction link
Steps to reproduce
Tabs
destroyInactiveTabPane: true
useEffect(() => alert('onMount'), [])
What is expected?
If the component was destroyed when the tab is closed, the
useEffect
should fire every time the tab is opened.What is actually happening?
It only fires the first time the tab is opened
I tested with both the
items
prop and the children and got the same result. Also tried addingforceRender
, but it doesn't do anything either.It does work if you set the
destroyInactiveTabPane
at the component level, but in my cases this would be highly undesired to destroy all the tabs!The text was updated successfully, but these errors were encountered: