segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
360 stars 185 forks source link

Tried to register two views with the same name RCTFBLoginButton #864

Closed schriker closed 1 year ago

schriker commented 1 year ago

react-native-fbsdk-next from @segment/analytics-react-native-plugin-facebook-app-events is causing conflicts. In our app we have facebook login implemented using react-native-fbsdk-next after installing plugin @segment/analytics-react-native-plugin-facebook-app-events and calling new FacebookAppEventsPlugin() app will crash with error:

Tried to register two views with the same name RCTFBLoginButton, js engine: hermes

This is happening for both iOS and Android

image

For workaround for now we just simply import react-native-fbsdk-next directly from @segment/analytics-react-native-plugin-facebook-app-events/node_modules/react-native-fbsdk-next

oscb commented 1 year ago

@schriker next release will change react-native-fbsdk-next to a peerDependency, I believe this should help in your scenario to have only 1 version of it in your app