Files
react-native/ReactCommon
Joshua Gross 87b94e60a6 Explicitly associate State with its owning ShadowNode immediately upon ShadowNode creation
Summary:
See comments for additional commentary. On Android we pass State to all views upon creation; currently we do Preallocation of views, which means that Views are created on the mounting layer before they're technically committed. Previously we were only assocation State -> ShadowNode upon tree commit.

This meant that during Preallocation, State was accessible but the `updateState` mechanism did not work because that requires a pointer from the State back to its owning ShadowNode.

We explicitly make that connection now when creating the ShadowNode and State. This should fix or prevent many subtle bugs with State, on Android but potentially other platforms as well, since now we guarantee that State is always updateable.

Changelog:
[[Internal]]

Reviewed By: shergin, mdvacca

Differential Revision: D17937687

fbshipit-source-id: a0cfdddbf1d97f1a64624bca6aa9536620f21ad4
2019-10-15 19:35:55 -07:00
..
2019-10-15 10:32:14 -07:00