Class Two Notes (301)
State and Props
React Lifecycle
React State vs Props
- Props works like passing arguments to a function, like what the component is intended to take, where props can change but not the componenet, so the component can be re-rendered with different contents
- State is handled (and updated) inside of a component, versus props are handled outside of the commponent (like a variable that can be changed)
- An application is re-rendered when the information is dynamic
- Things needs to be updated will be stored in a state, such as counter
When do we re-render our application?
What are some examples of things that we could store in state?
Things I want to know more about
How to use JS functions, constructors inside react when I am trying to render the page?
Back to main page
References