0

The following useState hook:

const [count, setCount] = useState(0)

...compiles to:

const [count, setCount] = (0, _react.useState)(0)

What is the purpose of the initial 0, ?

A link that shows the babel compilation.

Ben Aston
  • 49,455
  • 61
  • 188
  • 322

0 Answers0