What is the difference between React Native and React?

James W.

The Problem

You want to create interactive UIs using React, but where do you begin?

Both ReactJS and React Native can be used for creating UIs, but you need to know what the differences are, and which one is best for you.

The Solution

ReactJS

ReactJS is a Javascript library that is used to build user interfaces. ReactJS is used to create logical and reusable parts of a UI using functions called “components”.

Components are Javascript functions that return parts of a UI in HTML.

function Heading() { return <h>Hello World!</h> }

ReactJS uses JSX, which is a special syntax extension for Javascript that allows HTML markup to be written in Javascript code.

ReactJS has a massive open-source community, meaning there are many supporting libraries for you to use.

React Native

React Native is a Javascript library that is used to build UIs for native apps.

React Native lets you write Javascript and ReactJS for the Web, Android, iOS, Windows, TV apps, and more, all from a single codebase.

React Native is similar to ReactJS in that it allows you to create reusable components. It differs from ReactJS because it doesn’t use HTML as the building blocks for the UI. Instead, it uses native components that are found on the platforms you are building for.

With React Native you can tap into the features of a platform like push notifications and the camera on mobile devices.

So with React Native you can build an app that can run on multiple platforms without having to write code for each platform. It can be used to create a complete app, or it can be used to add onto an existing native application.

In Summary

ReactJS allows you to build UIs for the web using reusable components. React Native lets you build UIs for a number of platforms from the same codebase.

So if you are creating exclusively for the web or are looking to learn about creating UIs then ReactJS is your choice. If what you are building needs to be accessible across a number of different platforms then React Native is for you.

Join the discussionCome work with us
Share on Twitter
Bookmark this page
Ask a questionImprove this Answer

Related Answers

A better experience for your users. An easier life for your developers.

    TwitterGitHubDribbbleLinkedin
© 2023 • Sentry is a registered Trademark
of Functional Software, Inc.