Skip to content

Commit 0baeeee

Browse files
authored
Improved code example in layout-measurements.md (facebook#4372)
The parameters of the `MeasureOnSuccessCallback` are spread out across `x`, `y`, `width`, `height`, etc, instead of being in a variable called `measurements`. I've updated to the code example to reflect that.
1 parent 96d0a4f commit 0baeeee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/the-new-architecture/layout-measurements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ function AComponent(children) {
1313
const targetRef = React.useRef(null)
1414

1515
useLayoutEffect(() => {
16-
targetRef.current?.measure(({measurements}) => {
17-
//do something with the `measurements`
16+
targetRef.current?.measure((x, y, width, height, pageX, pageY) => {
17+
//do something with the measurements
1818
});
1919
}, [ /* add dependencies here */]);
2020

0 commit comments

Comments
 (0)