-
Notifications
You must be signed in to change notification settings - Fork 12
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 SDK doesn't load in React 18's StrictMode #221
Comments
We will include a fix for this in the next release. The fix has already been developed here: #217 In the meantime, you can try a release candidate that includes a fix: import {SplitFactoryProvider, SplitFactory} from '@splitsoftware/splitio-react';
...
const sdkFactory = SplitFactory(sdkConfig);
root.render(
<StrictMode>
<SplitFactoryProvider factory={sdkFactory}>
<App />
</SplitFactoryProvider>
</StrictMode>
); I will keep the issue open, let you know, and then close it when the release is done :) Thanks for sharing! |
Hi @TatarczykAVitesse , I’m closing this issue for now, as we’ve just released React SDK v2.0.1, which includes the update to support React Strict Mode, among other improvements and bugfixes. Try this new version on your side. Thanks again! |
It's still reproducing for me on 2.0.1. isReady is never set to true... |
I am sorry to hear that @MaxArnautFrontegg. I tried reproducing it on my side but wasn't able to. After updating So, I assume you are facing the issue in a different project. Could you please extend your example app to reproduce the issue with 2.0.1? Looking forward to your example so we can investigate further! |
Hello
I've been trying to integrate Split in my app but the features would never load (
isReady
property is never set totrue
) and it turned out it's because in the development mode I'm using React's StrictMode. As soon as I moved theSplitFactoryProvider
outside of it, everything starts to work properly.I prepared a reproduction repo based on the React's example app https://github.com/TatarczykAVitesse/react-typescript-sdk-examples
Interestingly, as soon as I downgrade from version 2 to version 1 of
@splitsoftware/splitio-react
, it starts to work with no further changesThe text was updated successfully, but these errors were encountered: