The best place to learn React.js
Javed Alam
Accessibility Specialist and UI-Frontend Developer | DHS TTV5 & NVDA-2022 Expert Certified | Mentor | Consultant | Remediation
First, make peace with the fact that you need to learn more than just React to work with React. This is a good thing, React is a library that does one thing really well, but it’s not the answer to everything.
However, identify whether what you’re currently learning is React or not, mainly so that you don’t get confused about your effort to learn React itself. A programmer who is comfortable with HTML and one other programming language will be able to pick 100% of React in 1 day or less. A beginner programmer should be good enough with React in a about a week. This is not counting the tools and other libraries that complete React like for example, Redux.
There is a question of the order you need to learn things, and it would vary based on what skills you have. It goes without saying that you need a solid understanding of JavaScript itself first, and of course, HTML as well. I like to be specific about this here, so if you don’t know how to map or reduce an array, or if you don’t understand the concept of closures and callbacks, or if seeing “this” in JavaScript code confuses you, you’re not ready for React, you still have a lot to do in JavaScript land.
Refreshing your knowledge on JavaScript first would not hurt, specially because you need to learn ES2015, not because React depends on it (it does not), but because it’s a much better language, and most of the examples, courses, and tutorials you’ll find use ES2015 syntax. Specifically, you need to learn the following:
The new features of the object literal and template strings
Block scopes and let/const vs var
Arrow functions
Destructuring and default/rest/spread.
Classes and inheritance (used slightly in defining component)
Imports and exports of modules (most important)
You don’t have to start with ES2015, but you do need to eventually lean it (and not because you’re learning React).
So other than ES2015 stuff, you need to learn the following to be a productive React developer.
The APIs of React, ReactDOM, ReactDOMServer: These are not big really, we’re talking about maybe 25 different things and you would rarely use them all. The documentation about them is readable but not the best place to start. Watch an online course, read a book, or join a focused workshop. Your options are endless here, but be careful what you pick and make sure it has a focus on React itself and not its tools and ecosystem.
node and npm: the reason you need to learn those (for React), is because there are a ton of tools that are hosted at npmjs.org that would make your life easy. Also, since Node allows you to execute JavaScript on your servers, you can re-use your front-end React code on the server (Isomorphic/Universal applications). Mostly, what you’ll find valuable with node and npm is working with module bundlers like webpack, this is much more important when you’re writing a big application, but you will need at least one tool to work with JSX (ignore the advice that JSX is optional.) Learn JSX and use it. The recommended tool is Babel.js
React ecosystem libraries: Since React is just the UI language, you’ll need tools to complete the picture and go beyond even MVC. Don’t start here until you’re very comfortable with React itself. I’ll give you 2 things to focus on, just forget everything else you encounter and learn these 2 in order first once you’re done with React itself: react-router and redux.
During your learning process, the best thing you can possibly do is build stuff with your own hands. don’t copy paste examples, don’t follow instructions blindly, but rather, mirror the instructions to build something else (ideally, something you care more about). Whatever you do, just do not build a TODOs app
I find building simple games to demonstrate the ideas of React much better than starting with data-driven serious web applications. That’s why in my getting started with React.js course, I focus on building a simple game. Try to implement another game in a JavaScript playground like that, it’s a good start, you don’t need a server, and you don’t need to manage a crazy state.