const [count, setCount] = useState(0);
count = 1;
In both cases, const is const.The fact that `setState` modifies state outside of the local scope does not mean that a local variable is not const. This is really basic programming, it doesn't have anything to do with React.
Here's the exact same scenario without React to show why you're wrong in your original comment:
const foo = () => {
const bar = getBarFromDatabase();
}
Imagine that this is a typical database where values can change, so that every time `foo()` is called, `bar` can have a different value. Do you think that this is a dirty hack that is overruling the const type declaration as well?