DEV Community

Discussion on: JavaScript Basics Before You Learn React

Collapse
 
jwhenry3 profile image
Justin Henry • Edited

My main suggestion is to not suggest that OOP is a necessity before learning react, as the direction it is heading is more Functional. React Hooks are more than the standard now-a-days to work with React so you may want to adjust the guide so we don't lead new developers astray.

If anything, learning the basics of Functional Programming will help to learn React quicker. The concept is relatively easy to grasp and you don't need to worry about inheritance, interfaces, etc right out the gate. Angular is definitely one where OOP is required.

The arrow syntax has more purpose than just the shortened syntax. You are able to retain the context of "this" while being passed around the system without needing to set a var outside the function and use it inside the function.
In a non-OOP environment, this isn't as important, however, if you do need a class to bundle functionality, then it becomes handy. I do advocate for arrow functions most of the time in React unless writing a component, just because it feels better to write

export default function SomeComponent(props) {
Enter fullscreen mode Exit fullscreen mode