Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[bugfix] fix imports for react-native-web #2797
This bug surfaced as a result of trying to use styled-components in an Expo universal project (React Native + React Native Web).
It's a pretty simple fix and all of the tests passed, so I hope that this is easy to review and possibly merge.
-- Juwan Wheatley (@FiberJW)
React Native Web doesn't use default exports, so importing using ES6 imports breaks it for that react-native renderer. Using require creates the same behavior in react-native and react-native-web without tripping up the navigator invariant that pops up when trying to import * as reactNative from 'react-native'.
Worked for me!