React 18 useState in 60 seconds

Опубликовано: 11 Март 2025
на канале: TheAdimar
499
9

The useState hook is one of the most important concepts in React, so it's crucial you know it. It's super simple to use and here I have a simple example how to do it: https://codesandbox.io/s/great-shadow...

useState accept an initial value as the first and only argument. It returns an array, where the first argument is the actual value stored in the state and the second argument is the function that modifies that value.

It's so simple, but also important, so make sure you learn it,