useIsomorphicLayoutEffect
useLayoutEffect in the browser, useEffect on the server.
For measure-before-paint code in components that also render on the server. CodeBlock, EventCalendar and Flow use it.
Usage
Examples
Measure before paint
API
1 option
1 return value
Accessibility
Measuring before paint avoids visible jumps that can disorient readers and move focus targets.
Notes
- Prefer useEffect unless you must read layout before the browser paints.
Related
CodeBlockCodeBlock renders syntax-highlighted source with an optional header, copy button, line numbers, highlighted and focused lines, diffs, folding and line selection.10 examplesEventCalendarSchedule events across day, week, month, agenda and resource views.5 examplesFlowA node-and-edge canvas for workflows, pipelines, agent trees and driver maps, themed with Gaudi tokens and built on React Flow.5 examples