Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

stub out non-web dependencies #96

Closed

Conversation

FLGMwt
Copy link
Contributor

@FLGMwt FLGMwt commented Sep 12, 2019

Hopefully fixes #95

Took a guess at naming / file location, let me know if there's somewhere we'd rather have these.

I could use some help testing this out as I'm not sure I'm doing the right thing to test this out. Here's what I tried:

  1. Create new expo project
  2. Add navigation/ex dependencies necessary for the stack example (https://reactnavigation.org/docs/en/next/hello-react-navigation.html)
  3. Make change in this branch to add stubs
  4. yarn lerna run prepare to build (I think? pulled from circle config)
  5. cd packages/stack && yarn link
  6. cd /my-expo-project && yarn link @react-navigation/stack && yarn add @react-navigation/stack
  7. ^ that somehow didn't pull in safe-area-view & @react-navigation/routers so I added them explicitly
  8. TypeError: Cannot call a class as a function errors from @react-navigation/core/lib/createNavigator.js, so I think I'm on the wrong path. How do y'all normally test react-navigation locally?

Any help would be appreciated!

@@ -0,0 +1,3 @@
//
export default () => null;
export const isMaskedViewAvailable = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have done platform.Select in a single "utils/MaskedViewStub.ts" file except that @react-native-community/masked-view makes a call to requireNativeComponent on module initialization so it blows up on web. The component noop should never be used, but I can make it least be a passthrough <View>{children}</View> if that's preferred.

@satya164
Copy link
Member

Thanks @FLGMwt. I'll do some tweaks and merge it.

@FLGMwt
Copy link
Contributor Author

FLGMwt commented Sep 16, 2019

For sure, go for it. Thanks much :)

satya164 pushed a commit that referenced this pull request Sep 17, 2019
satya164 pushed a commit that referenced this pull request Sep 17, 2019
@satya164 satya164 closed this Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

react-native-web: crashes on start
2 participants