State and Props
React Lifecycle
React Lifecycle
- Render comes before the component did mount
- the first thing to happen in the lifecycle of react is mounting the constructor
- things happen in the following order
- constructor
- render
- component did mount
- react updates
- component will unmount
- component did mount is used to load in things from a network request or DOM
React State vs Props
React State v Props
- You can pass in render content
- props cant be changed while state can be
- whenever the state is changed
- You could store an updating counter in a state