View on GitHub

reading-notes

Reading: useState() Hook

Review, Research, and Discussion

  1. How does React differ from vanilla JS/HTML/CSS?
    • Event handling in HTML and React are different from one another in terms of syntax and some rules. The reason behind this is that React works on the concept of virtual DOM, on the other hand, the HTML has access to the Real DOM all the time
  2. What is the primary difference between a function component and a class component?
    • A functional component is just a plain JavaScript function that accepts props as an argument and returns a React element. A class component requires you to extend from React. Component and create a render function which returns a React element. There is no render method used in functional components
## DOCUMENTATION :
Functional Components
A functional component is just a plain JavaScript function that accepts props as an argument and returns a React element.
Children / Child Components
Children allow you to pass components as data to other components, just like any other prop you use. … The special thing about children is that React provides support through its ReactElement API and JSX. XML children translate perfectly to React children

Review :

Why Hooks? source