let’s have a look at similarities and differences between ReactJS and ReactNative.
ReactNative and ReactJS are similar in one way, in fact ReactJS is the heart of ReactNative, and ReactJS and React Native both follow component-based architecture, you can write native mobile components in React Native to give off the feeling of a mobile app.
React Native is a mobile app development framework used to develop hybrid apps (IOS and ANDROID), and was released after 4 years of popularity of ReactJS by Facebook.
Bundling modules Requirement
While starting with ReactJS, which is a library, you have to start with choosing the bundler first like Webpack etc. besides that you must try to figure out what other modules you require for your project, because it’s a library you have to look for a way to get it compiled up.
Contrary of ReactJS where the developer chooses a bundler first ReactNative comes with everything you need due to the fact that it’s a framework. It’s way easy, just setup and start developing, in fact a single terminal command can make your life easy, and now with the release of Expo CLI 2.0 it becomes so much simple and developers friendly, you can click here to check out the details if you want to.
ReactJS uses HTML for app rendering, all the tags associated with HTML are applicable in ReactJS for the web app to be developed. i-e
as far as ReactNative does’t uses HTML to render the app but alternatively provides other Components that works the same as HTML tags and can be translated to something similar in HTML, where for example a
View component is similar to a
div tag, and a
Text Component is similar to a
Can JS-libs work with ReactNative?
As ReactJS works perfectly fine with other JS-libraries due to the fact that React renders HTML components to the app.
But for React Native the answer is a NO, because JS was actually designed for the Web to work with HTML tags, Since React Native doesn’t uses HTML to render the app, this also means you won’t be able to reuse any libraries you previously used with ReactJS, as the framework is unable to understand the code because it’s beyond it’s scope, but alternative components made our lives easier.
React applications are styled in conventional and most popularly way known as CSS-styling, as those HTML tags works very smooth with it.
You can do CSS like styleSheet styling in React Native but animation is no way near to CSS, you have to forget about animations in conventional CSS for web.
With ReactNative you’ll have to learn completely a new way to animate your component, recommended way is to use Animated API provided by React Native, simply you can do pretty much any kind of animation you would do on the web. React Native also provides PanResponders and LayoutAnimation.
To learn more about Animated and the PanResponder, this article can be very helpful: React-native Animated API with PanResponder
- ReactJS is the heart of React Native, so the learning curve is easy.
- React uses HTML to render the app, and ReactNative doesn’t.
- React Native doesn’t use CSS, it offers animation components.
Shortly, React is ideal for building dynamic, high performing, responsive UI for your web interfaces, while React Native is meant to give your mobile apps a truly native feel with the same codebase for IOS and Android.