Our First Stateful Component
Learn how to access and define state inside a React component.
We'll cover the following...
State inside a class component can be accessed with the instance property this.state
. However, it is encapsulated in the component, and neither parent nor child components can access it.
To define a component’s initial state, we can select from three ways. Two of these are relatively simple. The third is a little more advanced. We’re going to ...