Skip to content

Commit b13d063

Browse files
authored
Merge pull request #44 from ptrfrncsmrph/pm/correct-use-layout-effect-docs
Correct useLayoutEffect documentation
2 parents d5c0e96 + a4022df commit b13d063

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/React/Basic/Hooks.purs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ useEffectAlways effect = unsafeHook (runEffectFn1 useEffectAlways_ effect)
221221

222222
foreign import data UseEffect :: Type -> Type -> Type
223223

224-
-- | Like `useEffect`, but the effect is performed on every render. Prefer `useEffect`
225-
-- | with a proper dependency list whenever possible!
224+
-- | Like `useEffect`, but the effect is performed synchronously after the browser has
225+
-- | calculated layout. Useful for reading properties from the DOM that are not available
226+
-- | before layout, such as element sizes and positions. Prefer `useEffect` whenever
227+
-- | possible to avoid blocking browser painting.
226228
useLayoutEffect ::
227229
forall deps.
228230
Eq deps =>

0 commit comments

Comments
 (0)