View on GitHub

reading-notes

https://samahabujwaied.github.io/reading-notes/

How does React differ from vanilla JS/HTML/CSS?

Plain JS apps usually start with the initial UI created on the server (as HTML), whereas React apps start with a blank HTML page, and dynamically create the initial state in JavaScript. React requires you to break your UI into components, but plain JS apps can be structured in any way you see fit.

What is the primary difference between a function component and a class component?

Term Definition
Functional Components Functional component are much easier to read and test because they are plain JavaScript functions without state or lifecycle-hooks. You end up with less code. They help you to use best practices
Children / Child Components children is a special property of React components which contains any child elements defined within the component, e.g. the divs inside Example above. {this. props. children} includes those children in the rendered result