Slightly off-topic: how practical is it really to build devices (iOS and Android) and web from the same code base?
My poor understanding is that React Native, and hence Expo, doesn't use the same CSS frameworks as web development. I'm curious how that works from the same code base, or perhaps that's one of the major difficulties.
Also I see Expo as a fancy build framework but it's still fundamentally a RN application. Is this correct?
(My front-end colleagues are on another continent and we don't get any water-cooler time. Sorry for the possibly awful questions.)
I’m not using Expo but I do use Capacitor+Quasar to build cross platform apps to great success. I use it for my job and for my side business. Without it I doubt I could run my side business because I just don’t have the time as just 1 person to maintain 3 codebases.
I’ve never used Expo, React Native, or Flutter so can’t speak to those but I’m pretty happy with my setup. Yes I have to put a tiny bit of logic behind checks for if I’m on the web or if I’m in an app but it works surprisingly well overall IMHO.
It has become very practical / doable in the recent year or so. In my experience, if you have lot of frontend web experience, the easiest way to ship a RN app is by using Solito [0]. Also check out Nativewind [1] which allows you to style native apps the same way like you would on web. I was able to ship the first version of our app in about 1.5 weeks with this stack. Also checkout Tamagui [2].
Solito seems to let you share component code, but I assume that it does not share data fetching code? It doesn't do SSR for the native app? And in expo you'd be expected to `fetch` or otherwise get the data yourself (compared to next land where you can just use the next data loading stuff)?
Using Expo and React Native for web is not really practical. But simply having your mobile and web applications both in TypeScript you can share bits and parts of code, most notably the types & data models, application logic code, and assets (from simple image files, through lottie animations, to strings & their translations), but also potentially run some parts of your web application in a webview, ...
I have never attempted to use the web target of Expo, and probably would never try, not the least because so many dependencies assume that the target of a React Native app is either iOS or Android with the web having such different APIs, and the plethora of alternative options for the web.
The ‘and web’ bit I’ve never found to work well. There’s too many things that work differently on the web
As for the CSS part - yes, React Native uses order for priority, web CSS uses specificity. None of the attempts to get the RN way working on web were amazing
My poor understanding is that React Native, and hence Expo, doesn't use the same CSS frameworks as web development. I'm curious how that works from the same code base, or perhaps that's one of the major difficulties.
Also I see Expo as a fancy build framework but it's still fundamentally a RN application. Is this correct?
(My front-end colleagues are on another continent and we don't get any water-cooler time. Sorry for the possibly awful questions.)