Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does react-primitives detect which platform it's running on? #110

Closed
tonyxiao opened this issue Jun 9, 2018 · 5 comments
Closed

How does react-primitives detect which platform it's running on? #110

tonyxiao opened this issue Jun 9, 2018 · 5 comments

Comments

@tonyxiao
Copy link

tonyxiao commented Jun 9, 2018

And therefore which set of injection to use? Looking at the source code as well as published node module, it would seem that everything imports

require('./injection/react-native-web');
@mathieudutour
Copy link
Collaborator

it's not react-primitives which detect which platform it's running on, it's you build system. So the react-native bundler will take the .ios.js or .android.js files first, etc.

@tonyxiao
Copy link
Author

@mathieudutour I understand how .ios and .android works - however how does the web part work?

@tonyxiao
Copy link
Author

and sketch also

@mathieudutour
Copy link
Collaborator

on the web it's requiring index.js which is require('./injection/react-native-web'); and what you want.

For Sketch, skpm is looking for .sketch.js first.

In the end, it's just dependant of your bundler: what extension it prioritize.

@tonyxiao
Copy link
Author

Got it - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants