Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 19 support #2318

Open
RobinClowers opened this issue May 15, 2024 · 6 comments
Open

React 19 support #2318

RobinClowers opened this issue May 15, 2024 · 6 comments

Comments

@RobinClowers
Copy link

It appears recoil does not work with the react 19 RC that came out today. I'm guessing this will not be resolved, since Meta has abandoned this project, but I'd love to be wrong!

TypeError: react__WEBPACK_IMPORTED_MODULE_0___default().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED is undefined
    currentRendererSupportsUseSyncExternalStore index.js:511
    useRecoilValueLoadable index.js:5353
    useRecoilValue index.js:5372
@wojtekmaj
Copy link

It looks like replacing currentRendererSupportsUseSyncExternalStore body with return true does the trick. I mean, at this point it's probably better to migrate away from Recoil, but if you really, REALLY have to, then that could be a way to work around it.

@RobinClowers
Copy link
Author

@wojtekmaj thanks for chiming in! Definitely planning a migration, but nice to know there is an option if we want to defer it a bit.

@CarlosVergikosk
Copy link

It looks like replacing currentRendererSupportsUseSyncExternalStore body with return true does the trick. I mean, at this point it's probably better to migrate away from Recoil, but if you really, REALLY have to, then that could be a way to work around it.

Why would you say that at this point migration would be better? Thanks

@wojtekmaj
Copy link

wojtekmaj commented May 20, 2024

Why would you say that at this point migration would be better? Thanks

@CarlosVergikosk It's heartbreaking to say but I don't see Facebook is interested in keeping this project alive anymore. The latest version is broken in React Native (#2274), and has been for more than a year now.

At the same time, Recoil is no longer the only choice for using Suspense for Data Fetching and other, community-provided projects have not only caught to speed with Recoil, but surpassed it in terms of functionality, stability, maintainability, and community activity, the latter of which is a great factor for approximating project health.

Recoil was an amazing solution when it came out, but I'd advise anyone not to use it in new projects and consider migrating away from it in existing ones.

@CarlosVergikosk
Copy link

CarlosVergikosk commented May 20, 2024

Unfortunately i belive you are right @wojtekmaj, in terms of options to recoil, what would you suggest based on your experience?

Thanks for taking the time to contribute.

@wojtekmaj
Copy link

Depends on your use case. Here's my first thought:

  • Network intensive -> Tanstack React Query
  • State machines -> Zustand
  • Global simple state -> Jotai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants