Axios and Component State
What is State?
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

Rule of State
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.setStatesOnly change state with
setStateI, do not do this.state
Last updated
Was this helpful?