React's useState Hook in a function component knows that it deals with a number type. The returned state (here: count) has the type number in addition to the state updater function. When working with other types than primitives, inferring the type automatically does not always work.

2m read timeFrom robinwieruch.de
Post cover image

Sort: