Commit Graph

6 Commits

Author SHA1 Message Date
empyrical c7ec6002f1 Fabric: Use std::move on callback in Element::stateData (#29897)
Summary:
This pull request adds a call to `std::move` on the lambda capture in `Element::stateData`.

On Windows/Visual Studio 2017, this fixes a failure in the test `LayoutableShadowNodeTest.contentOriginOffset` where the error `std::bad_function_call` was being thrown. This was narrowed down to the callback being empty when called in `Element::stateData`.

https://github.com/facebook/react-native/blob/7e899348c74238a4a042380f86a8fe0d7e05511b/ReactCommon/react/renderer/element/Element.h#L98

Making sure the callback survives with `std::move` allows that test to pass under Windows.

## Changelog

Changelog: [Internal][Changed] - Fabric: Use std::move on callback in Element::stateData

Pull Request resolved: https://github.com/facebook/react-native/pull/29897

Test Plan: The Fabric test suite passes on Windows after this change is made. I also tested it under macOS and Linux built with Clang and they both pass with this change made.

Reviewed By: sammy-SC

Differential Revision: D23591969

Pulled By: shergin

fbshipit-source-id: e5c88bb0e94641e5128c4d49dd2f9dbfa49e9cfa
2020-09-10 10:45:59 -07:00
generatedunixname89002005287564 21186034af Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D23050679

fbshipit-source-id: 4b1a426425f55ef00190496e56cac0c8f1d44678
2020-08-11 05:12:56 -07:00
Samuel Susla efd005724f Convert LayoutableShadowNodeTests to use Element<>
Summary:
Changelog: [internal]

Use `Element<>` in `LayoutableShadowNodeTests`. It makes the tests cleaner and easier to understand.

Reviewed By: JoshuaGross

Differential Revision: D23028341

fbshipit-source-id: f7a2255581bdde667db0f68c222228a5b405b22f
2020-08-10 12:52:23 -07:00
Samuel Susla 6db19b036e Introduce Element<>.stateData API
Summary:
Changelog: [Internal]

Previous interface `Element<>.state` wasn't usable because creating ConcreteState  requires ownership of component descriptor and family. Family isn't created until later and it isn't accessible to the caller.

To work around this shortcoming, we create `stateData` rather than state.

Reviewed By: JoshuaGross

Differential Revision: D23028296

fbshipit-source-id: fba35ea8e6986b77379b1dddaa37012f4234f86e
2020-08-10 12:52:22 -07:00
David Vacca 08d7b542de Create Android OSS build system for react/utils module
Summary:
This diff creates the Android OSS build system for the module react/utils

As part of this diff I also moved the module to react/utils folder

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22877265

fbshipit-source-id: 717487aacb392d0f08530763a16a638b8021d501
2020-08-05 19:02:08 -07:00
David Vacca 3093010ea5 move fabric to ReactCommon/react/renderer
Summary:
This diff moves fabric C++ code from ReactCommon/fabric to ReactCommon/react/renderer
As part of this diff I also refactored components, codegen and callsites on CatalystApp, FB4A and venice

Script: P137350694

changelog: [internal] internal refactor

Reviewed By: fkgozali

Differential Revision: D22852139

fbshipit-source-id: f85310ba858b6afd81abfd9cbe6d70b28eca7415
2020-07-31 13:34:29 -07:00