Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

useEffect合并更新问题 #1633

Closed
xz-77 opened this issue Jun 28, 2021 · 1 comment · Fixed by #1635
Closed

useEffect合并更新问题 #1633

xz-77 opened this issue Jun 28, 2021 · 1 comment · Fixed by #1635
Labels
bug Something isn't working

Comments

@xz-77
Copy link

xz-77 commented Jun 28, 2021

bug 描述
在react库中 useEffect第二个参数的条件执行,多个值发生变更时会进行合并,但是在当前框架下,当多个值发生变更时,是分开执行的,并没有合并。与常规react的使用不一致

复现步骤
开发工具上照片中的demo,标签替换为小程序的View标签,即可复现。

期望结果
与正常使用react写法结果保持一致。

复现代码
[请提供一个可复现问题的代码仓库]

版本信息:

  • remax 版本: [2.9.1]
  • 手机型号 [iPhone 11]
  • 小程序端 [微信小程序]
  • 小程序版本[2.13.2 ]
  • 开发环境 [mac OS]

其他信息
image

@xz-77 xz-77 added the bug Something isn't working label Jun 28, 2021
@xz-77
Copy link
Author

xz-77 commented Jun 28, 2021

正常情况下,点击时间出发之后console.log(1)应该触发一次,但是在remax框架下,同样的写法会触发2次。

noyobo pushed a commit that referenced this issue Jul 4, 2021
yesmeck pushed a commit that referenced this issue Jul 6, 2021
* feat: 生命周期 & 交互事件支持合并更新

close #1633

* test: batchedUpdates

* chore: update yarn.lock

* fix: type

* test: update

Co-authored-by: 农有宝 <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant