This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
Replies: 1 comment
-
in renderScene
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to determine if a tab is the active tab like in this stackoverflow post.
My understanding is that all tabs are rendered by default. This means that even if a tab isn't the current active tab it will still be rendered (unless you use the
lazy
prop).I do not want to lazily load the tabs. I do want to be able to easily determine from an arbitrarily nested child component if it is being rendered on the active tab.
Desired API example (`isActiveTab`)
Is there an API similar to the React Navigation
useIsFocused()
hook?If not, I was planning on just adding some context that exposes the
index
state variable to arbitrarily nested children. Alternatively, I could use "prop drilling" to pass theindex
prop down the tree. I would like to avoid prop drilling if possible.Are there any performance considerations to be aware of using these approaches? For example, I don't want every tab change to re-render the entire tree. Does anybody have any suggestions for memoization?
Beta Was this translation helpful? Give feedback.
All reactions