How does react-primitives detect which platform it's running on?
tonyxiao opened this issue · 5 comments
tonyxiao commented
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 commented
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 commented
@mathieudutour I understand how .ios
and .android
works - however how does the web part work?
tonyxiao commented
and sketch also
mathieudutour commented
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 commented
Got it - thank you!