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.

Get Started With Sentry

Get actionable, code-level insights to resolve React performance bottlenecks and errors.

  1. Create a free Sentry account

  2. Create a React project and note your DSN

  3. Grab the Sentry React SDK

npm install @sentry/react
  1. Configure your DSN
import React from "react"; import ReactDOM from "react-dom"; import * as Sentry from "@sentry/react"; import App from "./App"; Sentry.init({ dsn: "https://<key>@sentry.io/<project>" }); ReactDOM.render(<App />, document.getElementById("root"));

Check our documentation for the latest instructions.

Loved by over 4 million developers and more than 90,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

Share on Twitter
Bookmark this page
Ask a questionJoin the discussion

Related Answers

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

    TwitterGitHubDribbbleLinkedinDiscord
© 2024 • Sentry is a registered Trademark
of Functional Software, Inc.