Achieving different behavior for web and ios/android #384
Closed
MehmetKaplan
started this conversation in
Ideas
Replies: 2 comments
-
It's going to be the same. The files with specific extensions still exist as separate files after compilation - they aren't bundled. So the correct platform will be picked up. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @satya164 , Thanks a lot, as you stated, it is working same way. My above-mentioned library (https://github.com/MehmetKaplan/react-native-webview-with-web) is working for both web and iOS & Android. So Iet me close the discussion... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to implement a library that will behave differently for
web
andios
/android
.The behavior can be forked at the build time by
react-native
, naming thejs
files asx.js
andx.native.js
, wherex.native.js
is used for iOS and Android at the build time, and similarlyx.js
is used for the web at the build time.But I am not sure how a library, built with
bob
will behave, considering it is going to be compiled either to CommonJS or ES Modules. For example, if I keep the naming approach same, will it be the same behavior? Any suggestions, how to approach to the subject?Brief of the business logic: Let me share the purpose of the library that I am planning. Even though it is not crucial for the above mentioned question, still it may give an idea, why I need the
web
vsios
/android
behaviors should be different. It will simply open aWebView
if the environment is theios
orandroid
. And if the environment isweb
then it will open a new window withwindow.open
and drive the user to the newly opened window.Beta Was this translation helpful? Give feedback.
All reactions