You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in my own application I noticed a strange behaviour that might depend on me missing out an important piece of how Leva works.
If I have 2 routes that both use the Leva useControls hook and navigate between them,
if there's some control with the same name on both the routes (ie. both pages have a control named 'width') then you'll receive a stale version of it during a client side navigation. This causes wierd behaviour if you for example have a route where width is 15 and another where it's 500, it breaks completely the thing you meant to display
I'm using the 'use client' at the top of the file so the component should be a client component and re-render accordingly?
Or am I missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there,
in my own application I noticed a strange behaviour that might depend on me missing out an important piece of how Leva works.
If I have 2 routes that both use the Leva useControls hook and navigate between them,
if there's some control with the same name on both the routes (ie. both pages have a control named 'width') then you'll receive a stale version of it during a client side navigation. This causes wierd behaviour if you for example have a route where width is 15 and another where it's 500, it breaks completely the thing you meant to display
I'm using the 'use client' at the top of the file so the component should be a client component and re-render accordingly?
Or am I missing something?
Thank you for your time :)
Beta Was this translation helpful? Give feedback.
All reactions