useState() Hook
Review, Research, and Discussion
- How does React differ from vanilla JS/HTML/CSS?
a. React requires you to break the UI up into components, and create the initial state in JS.
b. Vanilla JS starts everything out as a blank HTML page, and are you are able to structure everything anywya you like.
- What is the primary difference between a function component and a class component?
a. A functional component is just a plain JavaScript function that accepts props as an argument and returns a React element.
b. A class component requires you to extend from React. Component and create a render function which returns a React element.
Vocab
- Functional Components
a. A Functional component is a function that takes props and returns JSX.
- Children / Child Components
a. A component that recieves its props from its parent component, and data is always flowing one way.
Sources
- React vs Vanilla
- function vs Class
- functional Components