You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
This diff aims to restrict the usage of `Component.measure()` API to resolutions that occur during the layout phase. The API should be used in conjunction with `OnCreateLayoutWithSizeSpec` (for Spec) and `RenderWithConstraints` (for KComponents) when component resolution depends on size constraints.
Disallowing `Component.measure()` during the resolve phase is crucial for the following reasons:
- Size constraints is unavailable during the resolve phase
- Layouts created during resolve need to be cached separately, complicating reconciliation and layout caching
- Layout typically occurs after resolve, not vice versa. Hence performing layout during the resolve phase disrupts the natural sequence, leading to unnecessary complexity and potential issues.
By restricting `Component.measure()` to the layout phase, we ensure components remain reusable, maintain a stable progression of phases, and avoid potential performance regressions and hard-to-debug issues.
Reviewed By: zielinskimz
Differential Revision: D75129940
fbshipit-source-id: ccb5d8ca227f9c1fc9cd7f0a4ae662553836a61e
0 commit comments