easy-peasy
easy-peasy copied to clipboard
React 18
After upgrading to react version 18, easy-peasy stopped working. When we call API it doesn't rerender a component which uses useStoreState hook.
@w3bdesign Oh, it's not about the typing... However, of course i am not acknowledge good with a source code. But the problem is that it doesn't work properly. It seems because react 18 becomes "asyncronous"
Experiencing the same issue after changing to use reacts createRoot
Does not work
------------------------
const root = createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<BrowserRouter>
<StoreProvider store={store}>
<App />
</StoreProvider>
</BrowserRouter>
</React.StrictMode>
);
This works
-------------------
ReactDOM.render(
<React.StrictMode>
<StoreProvider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</StoreProvider>
</React.StrictMode>,
document.getElementById("root")
);
i have the same problem here. Alse using ReactDOM.render is not an optimal solution because we're missing all the new features introduced on react 18
i have the same problem here. Alse using
ReactDOM.renderis not an optimal solution because we're missing all the new features introduced on react 18
Am I guess... Seems this issue is not resolvable by easy-peasy ?
using ReactDOM.render works.
Also, for me, it does not work only the in the development environment
but works fine when you build using npm run build
I am using
"easy-peasy": "5.0.4"
"react": "18.1.0"
"@types/react": "18.0.8"
Removing React.StrictMode works for me, so that easy-peasy store updates are fired again.
Removing
React.StrictModeworks for me, so that easy-peasy store updates are fired again.
I guess the reason of existing React.Strict mode is quite respectful. I am afraid, your advice looks like not a solution.
For sure that's just a workaround, until the underlying bug is fixed.
For typescript users, you can try to use foca which support react 18 and type strong enough. Foca also based on redux + react-redux + immer
I don't use typescript. Because I am fed up with it. And I don't read Chinese. And don't get how a programmer may write a documentation using another language than English.
I don't use typescript. Because I am fed up with it. And I don't read Chinese. And don't get how a programmer may write a documentation using another language than English.
@OlekRia @w3bdesign Yep, Chinese is not friendly for west countries, I just searched this framework today, and actually I think it's time to write English documentation since foca is great enough to show it to people who also love redux in the world.
You know. Modern React Toolkit isn't bad as well and mature.
Guys, thanks for your advertisement. But I am interested in easy-peasy.
did you guys find a solution? im looking to upgrade react, but this is a showstopper.
@ctrlplusb any update on it?
Looking for an update, as while using next you can't really toggle strict mode, or any of the React 18 setup
@ctrlplusb Firstly, I love this lib. Use it on a few projects and it's helped me loads.
I'm keen to look at react 18 support, if it's something you don't have time for - is there any way I can help?
Hello everyone! I am having an issue in using easy-peasy in react 18, like for example when I change the value in the input it does not working properly the calling of api is not working also, can please help with this or am i the only experiencing this bug?
Am also getting the same issue with easy-peasy in react 18
@ctrlplusb I would really love to use easy-peasy, maybe by any chance you could look into this bug ?
Looks like the library is dead. leaving...
Hi ya'll. I'm going to begin looking into React 18 support. My initial intuition is that this might constitute a breaking change. I'll look into how other popular state libraries are handling this transition.
@ctrlplusb Man... It's too late...
~ redacted this comment, as I figured out a breaking change isn't required ~
Ok, some good news. The React team released a shim which allows me to do backwards support for React 16 and 17.
I've done an initial integration and all the source tests are passing. 🎉
I still need to fix the TypeScript definitions, and also need to look into the SSR story as my initial read on this is that it may need additional work. Looking good thusfar.
If you are happy to be an alpha tester on this please ping in this issue.
Yeah, I definitely need to extend the provider to support SSR for React 18.
So if anyone is doing an SPA, please volunteer for alpha testing.
I'll ping when the SSR story is sorted for wider testing.
😎
Ok ya'll. Anyone running an SPA, please could you test this alpha release;
yarn add [email protected]
On face value the SSR support doesn't look difficult. We should be able to land this very soon if user feedback goes well in testing the alpha releases.
Ok ya'll. Anyone running an SPA, please could you test this alpha release;
I have tested the alpha version and it works smoothly. Our store is not too small. It has many actions, thunks, thunkOns, computed states etc. The store keeps much data.
Thank you very much for restarting work on this very cool library.