set visible Index when I change Tab #294
-
Beta Was this translation helpful? Give feedback.
Answered by
asmyshlyaev177
Nov 18, 2024
Replies: 2 comments
-
Hi @durumi99 , can pass |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
durumi99
-
@durumi99 Another option is to try to pass current tab name as <ScrollMenu key={selectedTab}>
...
</ScrollMenu> |
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
Hi @durumi99 , can pass
apiRef
ref prop to menu, and reset state inuseEffect
, e.g. when selected tab changes.https://codesandbox.io/p/sandbox/react-horizontal-scrolling-menu-v2-apiref-vdr0d?file=%2Fsrc%2Findex.tsx%3A37%2C14