setState的结构出来怎么理解?
来源:5-1 用React表单、TS的类型继承和鸭子类型实现登录表单

慕粉3633604
2021-03-11
setState(…value,newValue),这个…value的意义是什么,为什么要这么写,这么写好处是什么,直接写setState(newValue)的缺点是什么?
写回答
1回答
-
Nolan
2021-03-11
setState({…value,newValue}) 和 setState(Object.assign(value, {newValue})) 是一样的
00
相似问题