HACKER Q&A
📣 soneca

Best way to make a React web into a native mobile app?


I have a React web app, a fairly simple CRUD on a serverless architecture. The UI in it is not that simple, but it's all well componentized and totally mobile first. The web app itself kind of already works like a native app, it doesn't even have routes.

My question is, what the easiest and/or best way to port it to native mobile apps?

My options so far seem to be:

- Rebuild everything in react-native-web

- Start a new React Native project, sharing the most code that I can (state management mostly, not UI)

- Port it to Ionic-React

- any other?

Thanks!


  👤 davismwfl Accepted Answer ✓
I can't believe this is coming out of my mouth/keyboard twice in one week. I do not advocate it but I will say it mostly works and that is to use Cordova. We have a react (w/sails) site we packed and shipped using Cordova and while I dislike it for a variety of reasons it does work. It would be a fast way to get a mobile app out but not invest the time to rebuild everything. You might have to tweak a few things but assuming you are using mainstream features it'll be fine generally.

I'd always suggest building an app either with Flutter or pure Native, but for quick get it out the door when you have a working site, Cordova will do it. FWIW, I have never used Ionic, only Cordova, my one concern is Cordova is already a logistic pain (close to a nightmare) so adding more abstractions on top of it (Ionic) seems like a bad idea. But again, never used Ionic so can't really say that my concern is valid there.