Axios and Component State
Last updated
Was this helpful?
Last updated
Was this helpful?
In anytime that we change the state of the component, the component will automatically render itself to the mobile devices screen
3 steps to implement State
Set default or initial state for the class component
Get the data and tell component’s state to update
Use this.setState({})
will auto trigger the UI update
Definition of state: a plain javascript object used to record and respond to user-triggered events.
When we need to update what a component shows, call this.setStates
Only change state with setStateI
, do not do this.state