-
Notifications
You must be signed in to change notification settings - Fork 70
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
Clarify why this SDK won't work in a React Native project #225
Comments
Hello @jkjustjoshing, thank you for reaching out. In your case (React Native Web only), as of this moment, trying to use this is the best bet. LaunchDarkly hasn't tested the
The SDK team has heard multiple feedbacks and understands this is not an ideal situation, so the SDK team is currently working on a new React Native SDK that is based on pure JavaScript without using a native module here: https://github.com/launchdarkly/js-core/tree/main/packages/sdk/react-native - However, that work is still in progress and we don't have a GA ETA for the new React Native SDK yet, so I am not sure would that meet your timeline. |
Thanks for the response @louis-launchdarkly. One part of my question to make sure gets answered - when you say
why would it be a waste of time? |
Currently, there is no CircleCI or build setup to test using the React Client SDK with Android or iOS, so LaunchDarkly cannot guarantee React Client SDK can work with React Native Mobile, and cannot support it if someone finds bugs that only happen for React Client SDK with React Native. And if I remember correctly, there is a difference in the event source libraries between browsers and Android/iOS that is likely incompatible. But LaunchDarkly and likely some other customers would love to hear back if there is a way to make React Client SDK work with React Native, before the new React Native SDK in pure JS is completed. |
I have an Expo React Native project I want to use LaunchDarkly with. However, at the moment the only build target we're using is web, using react-native-web. It's unclear to me if I should be using the React Native SDK or this SDK. This SDK explicitly says "The React SDK does not work in React Native projects", but the React Native SDK says "[...] the SDK uses native modules" (in the section about Expo managed workflows)
Describe the solution you'd like
Can you clarify why this SDK won't work in a React Native project? Are there certain features I can disable or abstain from using that will let me build this to a Native compile target in the future? Are these feature I can polyfill on Native?
How do you recommend someone use LaunchDarkly when they're using react-native-web to compile a React Native project to both web and Native?
Describe alternatives you've considered
For now I'll probably need to just use this SDK and cross my fingers it works when we prioritize compiling to Native in a few months. But I'd rather not introduce LaunchDarkly technical debt before I've written a single line of LaunchDarkly-specific code!
The text was updated successfully, but these errors were encountered: