Closed luhc228 closed 4 years ago
当 model 中的 state 初始值为0时,通过 useModelState API 获取 state 报错。
model
state
useModelState
原因为
const selector = store.useSelector(state => state[name]); if (selector) { // 当这里的selector === 0 statement为faslse, 无法正常返回 modelstate return selector; }
if (selector !== undefined) { return selector; }
问题描述
当
model
中的state
初始值为0时,通过useModelState
API 获取state
报错。原因为
fix