-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
State doesn't update with React 18 and new createRoot api react-dom/client #172
Comments
Hi @Juliangzr - we've been using the new way on our apps for a while now and we're not experiencing issues with the updates. Please could you create a small repro and we can see if there is something else going on here. |
Hello, i will try to reproduce it, but it's difficult because it's a big application. But i can tell for sure that when using createRoot there are problems updating the state. I just spent more than an hour experimenting random problems updating the state, until i changed again to the old way of rendering the app and all the problems were solved immediately. |
Just try create the most minimal version where things are not updating using the new method. I think there may be something in your configuration that's causing it- cause I also have a very large app using the new method and haven't run into any issues. It's hard for me to debug just from your current description. |
Ok, i am 100% sure that there's a problem. I will try to make a minimal app to show you. |
I've migrated my application to React 18 and i've noticed that the state isn't updating if i use the new root api to render the application (react-dom/client). When i change to the old root api it starts to work again
// React 18 - Old root Api - Works Fine
// React 18 - New Way - Doesn't Work
I am using the following packages:
I want to use the new root api because if i don't use it, the new performance optimizations of React 18 aren't enabled
The text was updated successfully, but these errors were encountered: