Fabric: Introducting State, an escape path from unidirectional data flow

Summary:
In React Native there are several use cases where React State is not the only input that affects the component tree. E.g., in case of a <Modal> component, the screen size directly affects the layout of components inside modal; in the case of uncontrolled <TextInput> component, the text inside the input affects the layout of the surrounding components. `State` is a special (legit!) workaround for all those similar cases. Native part of React Native maintains a special shared object between all nodes of the same family and use that during cloning and commits.

See coming commits to know how to use that.

In the near future State will fully replace LocalData concept but for simplicity they both exist for now.

Reviewed By: mdvacca

Differential Revision: D14217184

fbshipit-source-id: 6e018c5b68208d662462013bce0f4e2733d2f673
This commit is contained in:
Valentin Shergin
2019-02-27 00:29:19 -08:00
committed by Facebook Github Bot
parent b9107084f7
commit 802534e611
38 changed files with 699 additions and 37 deletions

View File

@@ -16,7 +16,7 @@ namespace react {
* This is a sample implementation. Each app should provide its own.
*/
ComponentRegistryFactory getDefaultComponentRegistryFactory() {
return [](const SharedEventDispatcher &eventDispatcher,
return [](const EventDispatcher::Shared &eventDispatcher,
const SharedContextContainer &contextContainer) {
auto registry = std::make_shared<ComponentDescriptorRegistry>();
return registry;