-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: React 18 support #4
Comments
Yeah I suspected this would happen. I just haven't been up on the new primitives. React 18 basically requires a new implementation for effectful state libraries. |
Here's a rough POC fix I suspect React 18 currently isn't working because function useNewForceUpdate() {
const [tick, setTick] = rState(0);
const fn = rCallback(() => {
setTick((t) => t + 1);
return () => {};
}, []);
const fn2 = rCallback(() => tick, []);
const state = rSyncExternalStore(fn, fn2);
return fn;
} I expect that this can be cleaned up, but I was mostly concerned with figuring out what was going on. |
Awesome. Thanks for looking into this. I guess MobX would have a similar mechanism. If this works tempted to do this. I suppose couldn't hurt to see where they landed, now that we know what to look for. |
I took a look at MobX's current React 18 support. While MobX currently works with React 18, it doesn't yet play nicely with suspense/concurrent features (see comments on the PR introducing React 18 support). The author of that PR calls out using I'll note that it appears that MobX already worked with React 18's change detection, as the PR which "adds" support for React 18 only updates the All of this is to say that, at the moment, it doesn't look like MobX can provide much insight but we should keep an eye on this issue. |
Just remove StrictMode and it will play nicely with React 18 |
Does this change sliminate the need to use |
It appears that
react-solid-state
doesn't support the new Renderer in React 18.Using the old render function with React 18 still works, but switching to the new render function in React 18 doesn't work.
The text was updated successfully, but these errors were encountered: