Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between React-native and Electron

I want to build a simple read-only app which should run on Android, iOS, Windows, OSX and Linux. Does electron support mobile platform? I couldn't figure out which one should I go for.

like image 777
mohitmun Avatar asked Sep 21 '16 07:09

mohitmun


People also ask

Does React Native use Electron?

React Native Windows offers more development languages than Electron, which means that you don't need much prior knowledge. When implementing an app using React Native Windows the main focus and the majority of code will be in JavaScript.

Is Electron a native app?

Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.

Is Electron related to React?

Electron is a cross-platform desktop application framework. It is used to build desktop applications with the JavaScript language. It's definitely also possible to use JavaScript frameworks like React and Vue to build desktop applications with Electron.

What is the main difference between React and React Native?

React is a JavaScript library of reusable components designed to create skeletons of the apps, whereas React Native is designed to build native mobile apps with reusable components.


2 Answers

Electron include chrome engine to render web pages as Native apps with support for different plugins to add desktop apps features.

Electrino doesn't include any render engine it uses the Safari engine on the Mac so the installation file is smaller than Electron. There's no support for Windows yet.

React Native is using a cross-platform render to Android and iOS.

Example: <Text> on Android will be TextView and on iOS will be UITextField

React Native Web made React Native work on web

Example: <Text> on web will be <p> or <label> not sure and after that, it can work on the desktop by electron

You can build universal apps by using this template by React Native code.

Also if you want a specific target you can add component.web.js or .electron.js or .android.js or .ios.js so it will render to this target only

https://github.com/react-everywhere/re-start/tree/react-16

like image 82
amorenew Avatar answered Oct 04 '22 19:10

amorenew


Take a look at PWAs. These can be installed on almost all the major mobile and desktop platforms plus it is a web app. https://developers.google.com/web/progressive-web-apps

like image 29
ravin001 Avatar answered Oct 04 '22 20:10

ravin001