In the previous section, we saw the usage of state for the regions; let's delve a bit deeper into that. The concept of state is very similar to props, but with crucial differences: props are assigned from the outside and are read-only, and state is handled privately, and read-write. If a component needs to keep some information, which it can use to render itself, then using state is the solution.
Handling state
How to do it...
Defining state is done by using class fields, a fairly new feature of JS, that's enabled via Babel since it isn't fully official yet. (See https://github.com/tc39/proposal-class-fields for the proposal, which is at Stage 3, meaning that it's one step away from being officially adopted...