What is React?
React is a JavaScript library for building user interfaces.
- Declarative
- Component-based
What is the Virtual DOM?
The Virtual DOM (VDOM) is a programming concept where an ideal or “virtual” representation of a UI is kept in memory and synced with the “real” DOM by a library such as ReactDOM. This process is called reconcilliation
What are controlled components?
A controlled component is one that takes its current value through props and notifies changes through callbacks like onChange. A parent component “controls” it by handling the callback and managing its own state and passing the new values as props to the controleld component. You could also call this a “dumb component”
What is an uncontrolled component?
A Uncontrolled component is one that stores its own state internally, and you query the DOM USING A ‘ref’ to find its current value when you need it.
Why Immutability is important?
What is the difference between Function components and Class components?
In React, function components are a simpler way to write components that only contain a render method and don’t have their own state. Instead of defining a class which extends React.Component, we can write a function that takes props as input and returns what should be rendered. Function components are less tedious to write than classes, and many components can be expressed this way.
Currently function components are preferred amongst developers
What does lifting state up refer to?
Lifting state is accomplished by moving the state up to the closest common ancestor of the components that need it. This state is then passed to components through their props.