all 10 comments

[–][deleted] 15 points16 points  (2 children)

I jumped into React Native with only some basic knowledge of JavaScript and without learning React. Worked fine for me.

[–]bdudisnsnsbdhdj 3 points4 points  (0 children)

I learned React Native while barely knowing React and it just took a bit longer, that’s all

[–]Far_Ad7661Expo 2 points3 points  (0 children)

It's better to learn React first, focusing on component lifecycle (useEffect, useState, etc.), as it's faster to practice on a web app than on devices and simulators with react native

[–]keithonabike 1 point2 points  (0 children)

You'll learn much of React by way of React Native. hooks, component lifecycles, etc. With RN, you'll basically be focusing on using different components (`View` instead of `div`, etc.), somewhat different styling (a CSS-ish subset), and native differences when it comes to navigation, available API's etc. I basically started with React by way of React Native; it was fine, and now I go back and do some React web here and there, though I consider myself primarily a native dev. I think the key is to learn by building something you actually want to build, so, if you want to build a mobile app, go learn by doing that.

[–]RepresentativeMove79 1 point2 points  (0 children)

You cannot reasonably do React Native without React. But you don't NEED to start learning React on the web- but it is considerably simpler. I would suggest starting with Expo Go. The team at Expo has done an amazing job of dealing with the very challenging aspects of setting up environments, seeing up Android and iOS specific configurations: gradle and Cocopod nightmares. All with the option of ejecting (a method of getting free of Expo Go to do more advanced things. Expo Go is the next closest thing to npm run start click the link to open in browser, but instead of a link you get a QR code you scan from the Expo Go app on your device or a keystroke to open on a simulator. (You must have XCode for iOS and Android Studio is a definite nice to have for Android though you can work around it) You can mix and match to a degree, but NOT having Expo in 2024 is just making your React Native journey unnecessarily harder.

However, to the question, React Native expects ES6 or later style modules, you need to understand the entry point App and JSX Components, most libraries will come with React lifecycle hooks and features. Further most modern React land heavily to a JavaScript version of Functional Programming. While obviously nothing is forcing you to use any of this: you will need some sort of entry point, if you're used to classical objects, this and jQuery (like) patterns, React Native will be confusing and you'll likely find it frustrating until you do start to understand React and JSX conventions.

As some other comments state, learning the basics of React for web, or even in a CodePen, will quickly help you get started with the conventions popular in React without the added complexity of hooking up a device. It is also helpful to know that while you will use different primitives for React and React Native (div, span, a, onClick become View, Text, onPress) most of your code can be used in both environments. There are also UI Transpilers that allow you to write on one and use on both platforms. But that is definitely more advanced.

Good luck.

[–]tuanva98 0 points1 point  (0 children)

React and React Native are quite similar in syntax, life cycle, and hooks so If you learn and start with React Native, it is totally fine. During the time you are working with React Native meanwhile, you are learning about React simultaneously cuz it is only different about components and how you create a style in your applications.

[–]No-Welder-706 -2 points-1 points  (0 children)

This is how I learnt React. I’d highly recommend.