We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序
https://gitee.com/wangluping/ref 小程序基础库: 2.20.0 使用框架: React
首页 滑动地图 会打印 Ref, 此时里面是有current的. 然后点击"去下一个页面"按钮, 进入test页面, 滑动地图, 打印ref, 此时里面是有current的. 然后返回首页, 再滑动地图, 此时打印的current为null
current为组件的this
current为组件的null
👽 Taro v3.3.9 Taro CLI 3.3.9 environment info: System: OS: Windows 10 Binaries: Node: 14.17.5 - D:\node\node.EXE npm: 6.14.14 - D:\node\npm.CMD
将test1组件中的的this.mapId变成随机的就不会出现这个问题
The text was updated successfully, but these errors were encountered:
@lupingW Taro 有一个 Map 去保存全局 dom 节点与其 id 的对应关系,但目前 Map 是全局的,没有按页面区分。因此这种情况下 Page2 dom 树的销毁会在 Map 中把 test1 组件的节点删除了。
暂时先用随机 id 绕过吧。
Sorry, something went wrong.
duplicate #7317
fix(runtime): 修复 id 冲突导致事件不触发的问题,fix #7317 #10720
c797e49
Taro v3.4 修复
No branches or pull requests
相关平台
微信小程序
复现仓库
https://gitee.com/wangluping/ref
小程序基础库: 2.20.0
使用框架: React
复现步骤
首页 滑动地图 会打印 Ref, 此时里面是有current的. 然后点击"去下一个页面"按钮, 进入test页面, 滑动地图, 打印ref, 此时里面是有current的. 然后返回首页, 再滑动地图, 此时打印的current为null
期望结果
current为组件的this
实际结果
current为组件的null
环境信息
补充信息
将test1组件中的的this.mapId变成随机的就不会出现这个问题
The text was updated successfully, but these errors were encountered: