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
{{ message }}
This repository was archived by the owner on Jan 1, 2025. It is now read-only.
The recoilWrapped function is encapsulated and exported in an npm package as follows: export default function recoilWrapped<T extends JSX.IntrinsicAttributes>(WrappedComponent: (props: T) => JSX.Element) { return (props: T) => { return ( <RecoilRoot> <WrappedComponent {...props} /> </RecoilRoot> ); }; }
This function is used in other projects by importing it from the npm package: import recoilWrapped from '@my-npm'; recoilWrapped(App);
Under normal circumstances, switching routes would result in a state reset. However, when using recoilWrapped, all other features of Recoil operate as expected, except that the state does not get reset.