Learn the difference between React, ReactDom and React Native.
React, often called ReactJS, is a platform-agnostic JavaScript library used to build user interfaces (UI). Agnostic means that React, the core technology itself, doesn’t care whether your project is a web app or native app.
React has some tools that allow us to develop on different platforms:
- ReactDOM is a React library that allows us to use React to build web applications and websites. This is what React is most known for. Some examples of companies that are using React for their web apps: Netflix, Airbnb, Dropbox, Marvel. The website you’re on now is a React web app.
- React Native is a React framework that allows us to build native mobile applications that you install via the App Store or Google Play. Instead of using Swift for iOS and Java for Android, React Native allows us to write one app, with React Syntax, and run it on both iOS and Android at the same time.
When educational publishers sell a React course, they don’t call it “ReactDOM for Beginners”. they call it “React for Beginners”. This is because prior to React v0.14, all ReactDOM functionality was part of the core React library — it was just called React. Now React and ReactDOM are two different libraries.
React Native was released a few years after React/ReactDOM.
What ReactDOM and React Native have in common today, is that they both depend on the React core library. So whether you’re building a web app or a mobile app, the core/parent technology, React, has to be imported at the top of your code files.
How do you know if a tutorial is referring to ReactDOM or React Native if they only write “React” in the title?
Usually, authors will include native in the title if they’re teaching about React Native for native mobile apps. When you only see React in the title, it’s implied that they refer to ReactDOM (for the web). I’ve never seen an exception.