相关疑难解决方法(0)

Why React Hook useState uses const and not let

The standard way to use a React useState Hook is the following:

const [count, setCount] = useState(0);
Run Code Online (Sandbox Code Playgroud)

However this const count variable is clearly going to be reassigned to a different primitive value.

Why then is the variable not defined as let count?

javascript ecmascript-6 reactjs react-hooks

25
推荐指数
2
解决办法
1095
查看次数

标签 统计

ecmascript-6 ×1

javascript ×1

react-hooks ×1

reactjs ×1