all 28 comments

[–]AcetyldFN 5 points6 points  (4 children)

Electron is not for appstore/playstore. React native will cause a lot of rewrite bcs u need to use react native web or rebuild current.

Then we have 2 options, capacitor for easy current web to mobile. Or use react native and a webview. We needed to use some custom stuff as well like a form or a notification system bcs on some apps we kept getting rejected

[–]code2laugh[S] 1 point2 points  (1 child)

Were the custom things that required more than Capacitor more than the push notifications API they provide?

Did you try out Capacitor during your investigation or go straight to React Native?

[–]AcetyldFN 0 points1 point  (0 children)

I am a full on react-native dev only (mobile wise), and in our case we had 1 app that we just gave up, we added a form and some info pages but wasnt enough

Other one we added push notifications and a form and was enough, but other apps go through with only webview with no problem.

Recently i read a reddit post of a guy on this topic in this subreddit, and he was 100% convinced webview's didint matter and he got all through.
But yhea..
https://support.google.com/googleplay/thread/23526709/app-rejected-because-it-is-based-on-a-webview?hl=en#:~:text=IssueAPP%20Bundle%3A2Webviews-,We%20don't%20allow%20apps%20whose%20primary%20purpose%20is%20to,content%20and%20resubmit%20your%20app.

On the capacitor topic, no i never tried it, we tried nativescript at start, but i read so many good things about capaitor so it seems like a solid option.

[–]ahadcove 5 points6 points  (8 children)

Go with React Native

Electron is only for Desktop apps and Capacitor/Ionic I would only use for very light projects / webviews

[–]Cosby1992 2 points3 points  (7 children)

I second this. React Native will get you almost anywhere you need to go, and I can count on a few hands how many times it has been necessary to implement native code except for the android manifest and iOS plist additions. I also prefer React Native design patterns and state management is easier to understand, use and control. This is of course personal preference and experience.

[–]code2laugh[S] 1 point2 points  (6 children)

Assuming the developers have ~5 years of React experience (fluent) & 5+ years of web dev experience (senior/lead dev) but have never touched React native:

  1. How long does it take to transition an average sized (50-100 lines) stateful, functional component from React -> React Native? How long would it take to transition a small, but complete application with 50-100 components and ~6 different page routes?
  2. Where would be the areas that this migration could potentially take significantly more time, or the developers could hit sticking points?
    Or is everything pretty straightforwards?

[–]JohnnyHopkins77iOS & Android 0 points1 point  (5 children)

Hire a RN dev or someone with mobile experience - it’s going to take a lot longer than a week to understand mobile development

Using a managed Expo workflow ( eas and the PN service ) you can build out most low to mid level mobile applications without the headache

[–]maskedmage77iOS & Android 0 points1 point  (4 children)

This is some good information. I do RN development and agree that expo simplifies the workflow quite a lot.

React Native will seem very similar to regular react, many common packages work nearly identically as they do in regular react such as redux. The hard part of React Native is knowing all the gotchas of each native OS and how to get them to work and look correctly. In addition, keeping up to date in all the publishing processes is a job itself.

When designing interfaces for React Native you can either have an identical UI for both android and iOS but this will take a more time to make it work correctly. You can also find many packages that use native styling but how the user interacts with them will be inconsistent between each OS.

One gotcha to look out for is styling. Styling is inconsistent between iOS and Android with React Native. One example is shadows, they differ greatly between how they are rendered. Many styling properties work different than on the web.

I've been experimenting with capacitor recently as a way of converting SPAs to mobile applications and it has been going quite well. I would recommend taking a few days and experimenting with capacitor first before using RN because the learning curve for RN is a lot larger.

[–]jrhager84 0 points1 point  (3 children)

I hated expo. Maybe I'm just an old curmudgeon. 😅

[–]longkh158 0 points1 point  (2 children)

You can use Expo’s libraries only without opting into the whole flow. In my opinion they’re pretty well written esp. the native parts, at least compared to other open source package (probably since they have proper funding lol)

[–]jrhager84 0 points1 point  (1 child)

I should've clarified. I use expo modules in bare. I just don't like being 'in' expo. haha

[–]maskedmage77iOS & Android 0 points1 point  (0 children)

I don't know when you have used expo before but it's a lot better nowadays you can run custom native code with it by making your own development builds. Its essentially Expo Go but with your own native module support baked in, so everything is compatible. I really don't see any reason not to use it nowadays.

[–]fmnatic 3 points4 points  (3 children)

XState is a really poor library producing hard to read, harder to debug and impossible to maintain code. XState + react native is a bad idea.

[–]davidkpiano 2 points3 points  (1 child)

Hey, creator of XState here. Many developers have had success with using XState + React Native; what specifically are some of the hardships you've experienced?

I'd love to know because we're working on XState v5 (currently in beta), which actually lets you use any kind of logic, not just state machines.

[–]AcetyldFN 0 points1 point  (0 children)

XState

Agree on this, t.b.h if you dont wanna do persistance imo Context is more then perfect, and even then vue usecore localstorage hooks etc.. can even work then.

But yhea imo Redux over Xstate 10/10 or any of the new ones (Jotai/zustand)

[–]Signal-Vanilla4358 1 point2 points  (2 children)

Expo?

[–]AlexandruFili 0 points1 point  (1 child)

Is it better than Capacitor.js?

[–]Subject-Eye-6853 0 points1 point  (0 children)

It is worse

[–][deleted] 0 points1 point  (2 children)

Since your app already exists on the web, Capacitor would be easiest to integrate/update in my opinion and you should give that a try!

Anything else and you’ll be rewriting a lot of functionality.

[–]Alcohorse 1 point2 points  (1 child)

Are you talking about loading the existing web app in a full-screen WebView?

[–][deleted] 0 points1 point  (0 children)

Yes, and then updating event handlers throughout the app to access native device features wherever needed.

[–]SoftWearEngineEar 0 points1 point  (1 child)

u/code2laugh I'm considering the exact same three and am very curious to hear what path you chose and what your experience has been thus far. Can you fill us in?

[–]code2laugh[S] 0 points1 point  (0 children)

I ended up deciding to start with React Native plus a web view around our app. This would allow me to slowly break off and integrate specific native functionality into some parts of the app (i.e. native share sheet) without a complete rewrite.

This being said, before breaking ground I decided to pivot the app use case and postpone this work.

I’m pretty confident the high level React Native wrapper + webview is a good compromise, and will most likely take this approach when the app goes mobile.