There is no way to learn something the easy way. You have to be patient. That applies for developers too. Personally, that's why I like being a developer, because there will be always something new to learn. If you stay curious, you will not be disappointed while becoming a developer. Learning is always a challenge, a challenge to hone your skills, if challenge and skill at hand are in balance. That's why it takes time to learn React as well.
"I had a job interview coming up where I was asked to complete a project in React. I sat down on a Saturday and worked through The Road to Learn React and on Sunday I completed my project with plenty of time left before my interview Wednesday. In one weekend I went from 0% to 80% comfortable working independently in React." (Source)
There are a couple of tech stacks that people want to learn with React straightaway. I want to pick up a few of them and give a brief explanation why it isn't a good idea to marry them with React while learning it:
Learn React with Gatsby? Gatsby.js got quite popular in the recent time. It's the go-to solution for creating static websites such as personal websites, blogs and landing pages. However, Gatsby comes with its own learnings such as GraphQL, its large plugin system, and the problems coming with server-side rendered React applications. So don't mistake Gatsby.js for having an easier time learning React. It makes writing static websites with React easier, but not learning React itself.
These were only a few things React beginners tend to associate with React when starting out with it. There are definitely more of them. However, they will not make the learning experience easier. In contrast, you will have to learn two things instead of one. So start out with React first before learning anything on top of it. Learn one thing at a time.
- bind(), apply(), and call()
- scopes and closures
- Object Methods
- Array Methods
- Prototypical Inheritance -> ES6 Class
- Callbacks and Promises
- Event Loop
- Event Bubbling
- Regular Expressions
- Error Handling
- Hoisting, Memoization
- Declarative vs imperative programming
- Functional vs object-oriented programming
After we got clarity about learning only React and React's prerequisites, let's see how to learn React from zero from there. I strongly believe the best start is going through the official React documentation. The documentation keeps up with the recent changes, is not biased, teaches you everything the React way, and is put together by the React core team and the React community in your interest.
Being referred to the documentation of a library as a beginner in web development can be intimidating. But I strongly believe it's the best way to learn something new. On your career path to becoming a developer, you will get used to learn new things with the documentation of the new thing, so why not get used to it now? It comes with certain benefits to learn documentation driven:
- beginner tutorial
- no commercial interest
- opinionated way of doing things
- thoughtfully put together by core contributors and community
- latest material and updates for new versions
- API references
Every time I pick up a new tech, I don't check any courses or books, I go straight to the tech's documentation and check whether there is a beginner tutorial. Often there is one and that's my entry point into a new world. From there, I can always check for other learning material, but my starting point will always be the official documentation of the new thing I intend to learn. After all, that's why I write my tutorials and books in close relation to the documentation by always refereing it in my guides. That's how beginners learn to use the documentation and that's what will make them more efficient and effective when learning a new tech in the future.
After you went through the React beginner tutorial from the React documentation and learned the basics of React from scratch, continue learning by building a project yourself before learning any other tech. It's not always simple to come up with project ideas, but there is plenty of inspiration out there.
For instance, there are also people who want to learn React by building games. I guess you will find plenty of React Tic Tac Toe implementations out there. Implement the game in React yourself and compare your solution to the other solutions. You will learn from your mistakes and learn to evaluate your source code against the implementation by others.
Learn React by doing is one of the most common recommendations you will get to hear from other developers, it applies to almost everything in life, because every task will present you with a new challenge to grow as a React developer. Also it is too easy to passively consume video courses, books, and tutorials. Get your hands dirty and implement something yourself. Get stuck with a problem, become desperate, ponder over the problem by taking time off the screen, solve the problem eventually, and reap the fruits of it. That's the basic framework of learning anything.
Confront yourself to stick to coding every day. You can participate in the 100 Days of Code challenge, write about it on Twitter or on your website. Make it a daily habit. Only when sticking to it for a while, by having the persistence and by coding every day, you will eventually become a React developer. It's a marathon and not a sprint.
The best way to learn something new is to learn it in public. Confront yourself with the feedback from other React developers by showing off your achievements. If you have reached a milestone with your React project, show it to others and ask for their feedback. These are a couple of commonly known platforms to share ideas around React:
You will not only get feedback from people there, but also dive more into React by joining discussions. Be part of the community. Another great way to learn something new yourself is to explain it to someone else. Maybe you are one step ahead of a fellow React beginner and can help them out. Checkout the React Beginner Thread in the React Subreddit where you can help fellow React developers to solve their problems.
After you went through the beginner tutorial in React's docs and started to implement a React project yourself, learn to use React with all its facets. React has only a slim API surface area, so try to get proficient with it.
- Learn about React's JSX syntax
- Learn about React Components
- Learn about React Component Composition
- Learn about React Props
- Learn about React State
Learn and understand React. In the end, it doesn't need much to create a React component that returns JSX, to use a React component in another React component while arranging them in a component hierarchy, to pass data from component to component with props, and to make components interactive with state. That's the gist of React. Learn React in depth by applying your learned skills in your project and not by consuming endless of content.
How to get started with actual coding a React project? If you don't have any editor/terminal or IDE installed and just want to checkout how React feels like in a code environment, checkout the go-to online code editor called CodeSandbox. Play around with React and checkout whether you like it. However, if you want to learn how to develop React applications on your local machine, checkout these MacOS and Windows Setup Guides to make it work on your machine:
Both guides come with a minimal set of recommended tools to get you started with React:
- Develop with Visual Studio Code: A popular lightweight IDE that is the go-to solution for React developers. Visual Studio Code (VS Code) comes with an editor to learn React development and a terminal (command line) to start your React project and install libraries for it.
- Learn with create-react-app: The go-to solution from Facebook and the React team to get you started with a lightweight and zero-configuration React starter project. 99% of the React tutorials out there build up on top of this starter project to get you started with React. You can focus only on learning React while all the toolings around it are taken care of by create-react-app.
- Format with Prettier: Opinionated code formatter that automatically formats your code in your development environment. It comes with a straightforward setup and integrations for popular editors (VS Code). While you learn React web development, it shows you how to format your React code.
- Learn React Hooks
- Learn React Higher-Order Components
- Learn React Render Prop Components
- Learn React Context
Being equipped with these advanced React techniques, you should be comfortable to dive into larger React applications where you will find these concepts and techniques more often. Due to React Hooks, the other Higher-Order Components and Render Prop Components may be less used in the future, but you should still see them fairly often throughout the next year.
After you went through React's documentation to learn about the basics and a few advanced concepts and patterns, and after you have started to build a React application yourself, definitely checkout other React resources online. Note that I mention this very late in this guide, because often React beginners are stuck in a never ending story of just consuming content to learn React. The thing I want to point out: Start to produce by developing React applications yourself or by writing about your learnings. Learning by doing is the key here. Every problem along the way can be looked up online. And then if you want to learn more about React, checkout all the other resources to learn React online. My recommendation is to not only consume one kind of learning material, but to diversify your learning resources:
- React Tutorials
- React Books
- React Videos (YouTube, Twitch, Online Courses)
- Web Development or React Podcasts
- Interactive Courses
However, not every kind of learning material may suit you. The same applies to the teaching styles of the people behind the larning material. Everyone has a different way to produce content and to offer it to their students, so checkout which teaching style is best for you.
"Initially, when first approaching React, I had purchased a Udemy course from another teacher. However, I found myself getting quite lost after just a few videos. The teacher in that highly rated series kept it easy at first but then blindsides you with hard to grasp concepts and code and failed to inform well what was going on. (Source)
If you are into reading, checkout online tutorials and React books. Print books are a good resources to learn React offline as well. Even though many people are afraid that books get outdated too quickly, I can only argue that most books are self-published and it takes the author only 1 day to have a new version of it online (even on Amazon). I believe it takes longer to update a video than written content nowadays.
If you are into watching, checkout online courses by individual developers on YouTube, Udemy and their own course platforms. However, again don't get stuck in only watching the content. Find content where you are forced to apply your learnings.
If you just want to keep up with recent React news, Podcasts are a great way to stay ahead of the curve. You will listen to developers being on the bleeding edge of the technology who always release something new to learn. Also Podcasts are a great way to keep learning React while commuting or while exercising in the gym. That's how I do it at least.
There are plenty of free React learning resources online that have a high quality and are accessible to everyone. If anyone asks me about becoming a React developer, I often just send them straightaway to FreeCodeCamp. Regardless of which learning resource you pick, try to stay pragmatic by applying the learnings yourself. Don't just passively consume the content. Be active and challenge yourself to hone your skills.
After you have learned only React and feel comfortable with its basic and advanced implementation details, there are plenty of learning paths you can take to advance your React skills. The React ecosystem is not opinionated but innovative and extensive. A couple of recommendations:
- React + React Router: Enable Navigation in your React application with a Router
- React + Firebase: Connect React to a Database and implement User Authentication/Authorization
- React + GraphQL: Connect React with a GraphQL interface to a Node.js backend application
- React + Redux: Explore predictable and scalable state management in React with Redux
That's it from my side. Stay curious, commit to it every day by getting your hands dirty, be public about it, and run a marathon and not a sprint. Challenge yourself to advance your skills as a developer and become a React developer this year!