mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 09:27:29 +08:00
Summary: Currently callbacks passed to native method are stored in [MessageQueue](https://github.com/facebook/react-native/blob/master/Libraries/BatchedBridge/MessageQueue.js#L160-L162) and [will be removed after invocation](https://github.com/facebook/react-native/blob/master/Libraries/BatchedBridge/MessageQueue.js#L273-L274), so to avoid memory leak in js-side the passed callback(s) must be invoked by native method. Because of this significant nuance of callbacks usage, which is not (or not directly) mentioned in docs, we have gained huge increase of ooms count in our app. So, I think this warning will help other developers to avoid this issue Closes https://github.com/facebook/react-native/pull/11444 Differential Revision: D4532764 Pulled By: lacker fbshipit-source-id: 34e99fa4944c3333b2198c1abd53c0da10732749