State in React

What a React component looks like is a reflection of its state - in this lesson, we'll look at how to use it and some potfalls

What is state?

The core of every React component is its state. The state determines what the component looks like, and you can update that as you go. The entire page won’t reload if a component’s state is updated only the component will - hence, it allows you to create pages that are dynamic and interactive. You can think of a component’s state like water’s temperature; changing temperature can significantly change what water looks like. If the temperature is brought below 0°C the water will solidify, if it is between 0°C and 100°C it will be a liquid, and if ...