lelandrichardson / react-primitives

Primitive React Interfaces Across Targets
MIT License
3.09k stars 108 forks source link

react-primitives will no longer work with RNW 0.11.2+ #129

Closed momsse closed 5 years ago

momsse commented 5 years ago

Since react-native-web@0.11.2 and further ReactNativeStyleResolver module does not exist anymore and cause react-primitives to crash at the injection step. See https://github.com/necolas/react-native-web/issues/1304 for more info.

It seems that createStyleResolver is a good replacer. At least it works for me ... for now :)

The only workaround that I found for now is to patch the module thanks to patch-package:

src/injection/react-native-web.js#L19

- const StyleRegistry = getDefault(require('react-native-web/dist/cjs/exports/StyleSheet/ReactNativeStyleResolver'))
+ const StyleRegistry = getDefault(require('react-native-web/dist/cjs/exports/StyleSheet/createStyleResolver'))()