From 21af4b1e221a9cbdf523e4be2ca7ac44e47710eb Mon Sep 17 00:00:00 2001 From: supun_yasantha034 Date: Thu, 26 Nov 2026 11:39:25 +0530 Subject: [PATCH] docs: fix JSX syntax error and component props in layout-measurements.md --- .../layout-measurements.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/the-new-architecture/layout-measurements.md b/docs/the-new-architecture/layout-measurements.md index 715cd42aee7..9dc94dbdf1c 100644 --- a/docs/the-new-architecture/layout-measurements.md +++ b/docs/the-new-architecture/layout-measurements.md @@ -9,20 +9,21 @@ The best way to invoke those methods is in a `useLayoutEffect` hook: this will g Typical code will look like this: ```tsx -function AComponent(children) { - const targetRef = useRef(null) - - useLayoutEffect(() => { - targetRef.current?.measure((x, y, width, height, pageX, pageY) => { - //do something with the measurements - }); - }, [ /* add dependencies here */]); - - return ( - - {children} - +function AComponent({children}) { + const targetRef = useRef(null); + + useLayoutEffect( + () => { + targetRef.current?.measure( + (x, y, width, height, pageX, pageY) => { + //do something with the measurements + }, + ); + }, + [/* add dependencies here */], ); + + return {children}; } ```