DEV Community

Discussion on: React Native Web platform specific web.js extension

Collapse
 
seanmclem profile image
Seanmclem

Awesome description. Very helpful thanks. I'm using expo lately and using web as a target, but also developing universally for android/ios. I'll neet some platform specific code eventually and it's good to see how to do the web files vs native

Collapse
 
gorbypark profile image
Mike Hamilton • Edited

I've found that I don't use iOS or Android specific files very much, as any minor differences can be handled using if (Platform.OS === "ios") { ... } within the same file. However, when making a multi-platform app that targets phones (small screens) and the web (sometimes big screens), there are so many differences that it's easier to have separate files rather than dozens of if statements that make the code hard to follow.