Grokking React Fundamentals
Vote

0% completed

​

State Data Types

Replacing a number in state and adding an item to an array in state look like the same kind of change. React treats them differently, however, and the difference decides whether your screen updates at all. A state variable can hold any JavaScript value, and this lesson follows one component through the common kinds of values: strings, numbers, booleans, arrays, objects, null and functions.

The Running Example

The Profile component below keeps six pieces of state about one person. It uses map to turn the skills array into list items, as the Lists chapter showed, and the `??

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content