dialectlabs / blinks-react-native

MIT License
10 stars 4 forks source link

Conflict between react-native-picker-select and Blinks SDK Causes Invariant Violation Error #6

Open ramyodev opened 3 weeks ago

ramyodev commented 3 weeks ago

Issue Summary

When using react-native-picker-select in a project that also incorporates the Blinks SDK, the application fails with an invariant violation error. This issue appears related to a conflict over the registration of the RNCPicker view component when the Hermes JS engine is in use.

Steps to Reproduce

  1. Install react-native-picker-select and Blinks SDK in a React Native project.
  2. Import and use Picker from react-native-picker-select as shown in the example below:
    import Picker from 'react-native-picker-select';
    {placeholder && <Picker onValueChange={handleCountryCodeChange} items={COUNTRY_CODES} style={pickerSelectStyles} placeholder={placeholder} />}
  3. Run the application using the Hermes engine.

Expected Behavior

The application should load without errors, allowing the Picker and Blinks SDK to function simultaneously.

Actual Behavior

The application throws an error upon startup:

ERROR Invariant Violation: Tried to register two views with the same name RNCPicker, js engine: hermes

Environment

prsvic commented 2 weeks ago

Hey @ramyodev,

This might be caused by having two different versions of the @react-native-picker/picker library installed. The react-native-picker-select library requires a peer dependency on @react-native-picker/picker, and the Blinks SDK also brings it as a dependency.

Could you check your yarn.lock (or whichever lock file you’re using)?

If you do find two versions, try resolving them to a single version and please let me know if the issue still persists.