diff --git a/README.md b/README.md index 783fdb5..a9150a7 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Looking to expand your knowledge on Javascript as well? Check out our comprehens
-

1. How does React work?

+ 1. How does React work?
React creates a virtual DOM. When the state changes in a component it first runs a "diffing" algorithm, which identifies what has changed in the virtual DOM. The second step is reconciliation, where it updates the DOM with the results of diff. @@ -31,7 +31,7 @@ React creates a virtual DOM. When the state changes in a component it first runs
-

2. What are the advantages of using React?

+ 2. What are the advantages of using React?
- It is easy to know how a component is rendered, you just need to look at the render function. @@ -44,7 +44,7 @@ React creates a virtual DOM. When the state changes in a component it first runs
-

3. What is the difference between a Presentational component and a Container component?

+ 3. What is the difference between a Presentational component and a Container component?
Presentational components are concerned with how things look. They generally receive data and callbacks exclusively via props. These components rarely have their own state, but when they do it generally concerns UI state, as opposed to data state. @@ -57,7 +57,7 @@ Container components are more concerned with how things work. These components p
-

4. What are the differences between a class component and functional component?

+ 4. What are the differences between a class component and functional component?
- The class component uses ES6 class syntax, and it extends React components with a render method that returns React elements. @@ -68,7 +68,7 @@ Container components are more concerned with how things work. These components p
-

5. What is the difference between state and props?

+ 5. What is the difference between state and props?
State is a data structure that starts with a default value when a Component mounts. It may be mutated across time, mostly as a result of user events. @@ -79,7 +79,7 @@ Props (short for properties) are a Component's configuration. They are received
-

6. What are the different lifecycle methods?

+ 6. What are the different lifecycle methods?
- `componentWillMount` (deprecated) - this is most commonly used for App configuration in your root component. @@ -94,7 +94,7 @@ Props (short for properties) are a Component's configuration. They are received
-

7. Explain React Hooks.

+ 7. Explain React Hooks.
Hooks let you use more of React’s features without having to use classes. The first hook that you will most likely encounter is useState. useState is a Hook that lets you add React state to function components. It returns an array with a getter and a setter. @@ -131,7 +131,7 @@ useEffect(() => {
-

8. Where in a React class component should you make an AJAX/API request?

+ 8. Where in a React class component should you make an AJAX/API request?
`componentDidMount` is where an AJAX request should be made in a React component. This method will be executed when the component `mounts` (is added to the DOM) for the first time. This method is only executed once during the component’s life. Importantly, you can’t guarantee the AJAX request will have resolved before the component mounts. If it doesn't, that would mean that you’d be trying to setState on an unmounted component, which would not work. Making your AJAX request in `componentDidMount` will guarantee that there is a component to update. @@ -140,7 +140,7 @@ useEffect(() => {
-

9. What are controlled components?

+ 9. What are controlled components?
In HTML, form elements such as ``, `