fix(RN): enhance RN IntersectionObserver lifecycle and cleanup logic - #2585
Merged
Conversation
hiyuki
reviewed
Sep 11, 2026
hiyuki
reviewed
Sep 14, 2026
hiyuki
reviewed
Sep 14, 2026
hiyuki
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix (RN)
背景
排查 RN 曝光监听连续报错时,发现业务在滚动回调中反复创建 IntersectionObserver,未及时断开旧实例,导致实例累积并触发 Hermes 属性存储上限。
排查同时发现框架在主动断开和组件卸载时存在清理不完整的问题。本 PR 修复框架侧生命周期清理;业务侧反复创建 observer 的问题已同步业务方另行调整跟进。
修复内容
disconnect()完整移除注册及持有的引用,取消尚未执行的节流测量任务,忽略在途测量结果,确保断开后不再触发业务回调,并支持重复调用。验证
微信原生表现观察
本次真机环境:iOS 26.7、微信 8.0.76、基础库 3.17.2。