NervJS / nerv

A blazing fast React alternative, compatible with IE8 and React 16.

Home Page:https://nerv.aotu.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

h5 中 setstate的回调 不执行

daijiaoluoxinghui opened this issue · comments

问题描述
h5 和weapp setstate的回调 不一致,如下面的代码,h5只有执行到5,weapp会先到5,然后到1

复现步骤
[复现问题的步骤]

  1. npm run dev:weapp
    2.npm run dev:h5

[或者可以直接贴源代码,能贴文字就不要截图]

componentWillMount() {
        this.setState({lefthour:5},()=>{
            this.setState({lefthour:1})
        })
}
render(){
   console.log(this.state.lefthour,'lefthour')
}

期望行为
跟weapp表现一致

报错信息
h5的
image
weapp的
image

系统信息

Taro CLI 1.2.20 environment info:
System:
OS: Windows 7
Binaries:
Node: 8.15.0 - D:\node\node.EXE
npm: 6.5.0 - D:\node\npm.CMD

  • 报错平台 [h5]

补充信息
[可选]
h5中,setstate的回调没有执行。

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

已修复 0e38891

更新 nervjs 到1.3.13即可