0

From what I know

A const variable cannot be changed

  • 1
    Does this answer your question? [How does JavaScript mechanism behind react hooks work?](https://stackoverflow.com/questions/53895455/how-does-javascript-mechanism-behind-react-hooks-work) – barshopen Jan 21 '21 at 09:22

1 Answers1

0

I think you are talking about react-hooks.

const [count, setCount] = useState(0);

Here, const is a guard against reassigning the value of the reference within the same scope.

Honey
  • 2,208
  • 11
  • 21