10 Difference Between React.js and React Native

Generic placeholder image
Brijpal Sharma
react reactjs  

Date:-February 14th, 2019 , Posted On:- Web Development


So today's topic is that 10 Difference Between React Js and React Native, React.js is made up of two words where React stands for a JavaScript library and .js means JavaScript and other hands React Native is a framework for building native applications using JavaScript.

10 Difference Between React.js and React Native

React.js

Basic React.js is a modified version of JavaScript that is used to create a good user interface and React.js has developed by Facebook. React.js is responsible for developing a hierarchy of UI components that mean rendering of UI components.

10 Difference Between React.js and React Native

Code Sample

import React, { Component } from 'react';
import ReactDOM from 'react-dom';

class Clock extends React.Component {
  constructor(props) {
    super(props);
    this.state = {date: new Date()};
  }

  componentDidMount() {
    this.timerID = setInterval(
      () => this.tick(),
      1000
    );
  }

  componentWillUnmount() {
    clearInterval(this.timerID);
  }

  tick() {
    this.setState({
      date: new Date()
    });
  }

  render() {
    return (
      <div>
        <h1>Hello, world!</h1>
        <h2>It is {this.state.date.toLocaleTimeString()}.</h2>
      </div>
    );
  }
}

ReactDOM.render(
  <Clock />,
  document.getElementById('root')
);

React Native

React Native is a framework for develope a Naive Application using JavaScript. React Native make possible to develop a Native mobile application. The best thing about React Native is supporting both Android and iOS, that means apps made on Reactive Native can be run on both Android and iOS.

Code Sample

import React, { Component } from 'react';
import { Text, View } from 'react-native';

class WhyReactNativeIsSoGreat extends Component {
  render() {
    return (
      <View>
        <Text>
          Hello world.
        </Text>
        <Text>
         React Native is awesome.
        </Text>
      </View>
    );
  }
}

 

S.No React.js React Native
1. ReactJS is a JavaScript library. This is a mobile framework that compiles to native app components.
2. Supporting both front-end web and being run on a server.  React Native Allowing you to build native mobile applications for different platforms (iOS, Android, and Windows Mobile) in JavaScript.
3. For building user interfaces and web applications. For building mobile applications.
4. This is a declarative, efficient, and flexible JavaScript library for building user interfaces. With help of React Native, you build mobile apps using only JavaScript. React native allows to uses the same design as React, letting you compose a rich mobile UI from declarative components.
5. For React.js you need DOM for path rendering of HTML tags. React-Native uses AppRegistry to register your app.
6. React.js is a web application javascript library. React Native is a framework for real mobile app. 
7. You can reuse code component in React.js saving a lot of time.  React Native has Reusable UI components & modules that allow hybrid apps to render natively.
8. React usesHTML-CSS for defining interfaces and it also improve SEO fo But React native has a separate set of tags for defining the user interface for mobile.
9. Its give high-performance website and web application. It gives a high-performance mobile application.
10. Open sourced by Facebook. Open sourced by Facebook.

 

So here we complated today topic 10 Difference Between React.js and React Native.

 


About the author

user profile
Brijpal Sharma

Hello, My Name is Brijpal Sharma. I am a Web Developer, Professional Blogger and Digital Marketer from India. I am the founder of Codermen. I started this blog to help web developers & bloggers by providing easy and best tutorials, articles and offers for web developers and bloggers...

0 comments

You must be logged in to post a comment.