Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Conversation

richardhuaaa
Copy link
Contributor

This line was added in React Native 0.35.0: https://github.com/facebook/react-native/blob/v0.35.0/Libraries/Utilities/MessageQueue.js#L194 (facebook/react-native@145109f). It essentially deep freezes (or makes immutable) any object sent from JS to Native over the bridge. This object is already pass-by-value to begin with, so I assume the purpose of this is to avoid any ambiguity or confusion that might occur if the object is modified while it is sitting in the message queue.

We do send a localPackage object over the bridge, which we modify afterwards. Because we only care about the value of this object at the moment that it is queued, the fix is to make a copy of it before sending it over the bridge.

This is relevant to issue #536 (RN version support).

@richardhuaaa richardhuaaa merged commit 392189f into master Oct 12, 2016
@richardhuaaa richardhuaaa deleted the support-rn-35 branch October 12, 2016 00:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants