12 Tweets 2 reads Jul 13, 2022
What much JavaScript should you learn before moving to React?
A thread ๐Ÿงต
1. JavaScript Language Fundamentals
a. var, let, and const
b. Operators (arithmetic, comparison, logical)
c. Conditionals and Loops
d. Arrays
e. Objects ( learn -> cutt.ly )
f. Functions ( learn -> cutt.ly )
2. ES6 Classes
New React applications are built using functional components with something called 'React Hooks', but you will definitely come across Class-based components.
You can learn everything about ES6 Classes in my blog post linked below -
faheemkhan97.hashnode.dev
3. Destructuring assignment
a. Array Destructuring
b. Object Destructuring
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables(From MDN)
cutt.ly
4. Modern Operators -
a. Spread/Rest Operator
b. Ternary Operator (Not modern tho ๐Ÿคญ )
Ternary operators are widely used in React for conditional rendering.
5. Arrow Functions
const add = function(a,b) {
return a+b;
}
And,
const add = (a,b) => a+b; // Arrow Function
both are the same.
See, how short and concise are arrow functions.
6. Newer array Methods
a. map
b. reduce
c. filter
d. find
e. findIndex
Learn my article to become pro at using these(top 3) methods
faheemkhan97.hashnode.dev
7. Higher-Order functions
You will encounter Hooks in React which are higher-order functions. They take another function as an argument.
Learn more about higher-order and callback functions here
faheemkhan97.hashnode.dev
8. import and export statements
Every JS file is a module in itself. In react, the Whole web app is a collection of a bunch of components.
We write them in separate files and export them & then import them to use
9. Working with APIs
No matter what React application you're building, you're definitely going to use APIs. So get comfortable at working with it.
Working with APIs involve callbacks, Promises, and async-await.
Learn these 3 in the process as well.
You should read this article before starting React. ๐Ÿ‘‡๐Ÿผ
faheemkhan97.hashnode.dev
This is all you need to know before jumping to React.
What if you jump to React without knowing these?
You will find your journey difficult. you will be required to learn JS and React together and this is not productive.
Feel free to add if you think I missed something. ๐Ÿ˜‰

Loading suggestions...