Questions regarding sidebar behaviour and closing animation #2951
Unanswered
manuelpoelzl
asked this question in
PrimeReact
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I currently use a sidebar inside my react app which has some states and I'd like to reset them whenever the sidebar closes.
Since there are some states, I don't want to make a function that resets all states.
Coming from fluent UI Lib i see that there the initial
useEffect
call is only triggered, if the panel is actually shown, here in Prime, the hook is triggered, even if it is not actively rendered. Also on Fluent when I close the panel, the underlying component is getting reset to its default values, here it is persistent. I tried specifying thekey
prop on the sidebar, which works but then the closing animation of the panel is gone and it just disappears.I've provided a sample here: Panel test
To replicate:
So basically my two questions are:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions