-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds IViewManagerWithOnLayout interface for ABI VMs (#10424)
* Adds IViewManagerWithOnLayout interface for ABI VMs Core VMs can override `SetLayoutProps` to get a callback just before native layout values are applied from Yoga. There is no option to observe these changes from Yoga in ABI VMs. This change introduces a new interface to receive a callback when computed Yoga layout values are being applied to a native view. We have a use case for this interface that is also dependent on #10422 (ensuring parent SetLayoutProps occur after children), #10237 (adding an API to invoke nested Yoga layout for a given React tag), and #10393 (custom measure func). Specifically, the following sequence occurs: 1. Prop updates cause Yoga layout to be applied on a root node 2. SetLayoutProps is invoked on children of custom VM, Top/Left/Width/Height get set 3. SetLayoutProps/OnLayout is called on the custom VM 4. Custom VM runs logic to re-caclulate dimensions of each child in OnLayout 5. Custom VM invokes XamlUIService::ApplyYogaLayout with computed dimensions on each child. 6. Custom VM applies Top/Left values to children. The custom measure function is used in this example to prevent children from having Yoga layout computed twice. * Change files * Ensure we set the IViewManagerWithOnLayout instance to ABIViewManager * yarn format
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-35fd02cc-01fa-43b1-9ea7-2fdc02b19210.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Adds IViewManagerWithOnLayout interface for ABI VMs", | ||
"packageName": "react-native-windows", | ||
"email": "erozell@outlook.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters