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
Switch uses React.Children.forEach to capture the matching element, while CacheSwitch uses React.Children.map to return an array(React assigns keys to each child in the array).
In
Switch
, the component will not be re-mounted even if the path changed.Here's a demo to reproduce.
https://stackblitz.com/edit/vitejs-vite-4923pg?file=src/App.tsx
Go
button, then the component underCacheSwitch
will be re-mounted.Go
button, the component underCacheSwitch
will be re-mounted.The text was updated successfully, but these errors were encountered: