Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 323 Bytes

use-isomorphic-layout-effect.md

File metadata and controls

11 lines (8 loc) · 323 Bytes

useIsomorphicLayoutEffect

Same as React's useLayoutEffect, except that it will only attempt to run client-side (thus silencing React's warning against useLayoutEffect during server-side rendering).

Example

useIsomorphicLayoutEffect({
  // do something synchronous!
}, [/* effect dependencies */]);