How different are React and React Native? How difficult would it be to learn and pick up React Native after FreeCodeCamp say at a job?

I was just told that I will have to learn React Native and will be provided with the resources to learn it at my new job which I might begin tomorrow. So I was wondering how different React and React native are. What I know so far are that instead of html elements React Native has things like view and some other tags. That’s all I know. Anyone who knows it can you share your experience.

React doesn’t care what you’re rendering to, that’s what the rendering library does (ReactDOM for DOM, Three-Fiber/ART/etc for rendering to HTML canvas, React Native for iOS/Android/Microsoft Apps, Ink for terminal applications, etc). So React Native is the equivalent of ReactDOM (albeit with an attached library of components), not React. You still use React the exact same way, because it’s still just React you’re using, it isn’t a special different version of React, it’s the exact same library whether you’re building web apps or native apps or terminal app or whatever.

It has requires more complex build tools due to it being for building native apps, but that doesn’t change that it’s just the same code you’re writing. The specific component library components it ships with (View, Text etc) are needed because there’s no DOM, but it’s just as if you already had (as a simplified example) for web:

const View = (props) => (
  <div>{ props.children }</div>
)

There isn’t anything particularly special about using them beyond that – they have a load of props that are RN-specific but it’s just the same as using any other component in React

1 Like

Thank you for a detailed answer. I really appreciate it.

Good to know this.

1 Like

You’ll be fine I think :slightly_smiling_face:. The things you are likely to find alien are, as I say, build tools. For example, React Native is the only time I ever touch either XCode or Android Studio, which are both complex IDEs, and I generally have to Google every single time I open either. But that’s not really to do with React.

Navigation is also sightly bizarre, coming from web. Whatever you end up using (React Navigation is the most common) will take some time for you to get used to, but at the end of the day it’s just a library which you need to learn the API for (same with Redux, or React Router, or whatever)

1 Like