Quantumbraid/trainingdata / ui /node_modules /use-isomorphic-layout-effect
3.85 GB
70,867 files
Updated 17 days ago
Name
Size
dist
package.json2.93 kB
xet
README.md625 Bytes
xet
LICENSE1.07 kB
xet
README.md

use-isomorphic-layout-effect

A React helper hook for scheduling a layout effect with a fallback to a regular effect for environments where layout effects should not be used (such as server-side rendering).

Installation

$ npm i use-isomorphic-layout-effect

Usage

You only need to switch useLayoutEffect with useIsomorphicLayoutEffect

+ import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';
- import { useLayoutEffect } from 'react';


const YourComponent = () => {
+  useIsomorphicLayoutEffect(() => {
-  useLayoutEffect(() => {
    // your implementation
  }, []);
};
Total size
3.85 GB
Files
70,867
Last updated
Nov 3
Pre-warmed CDN
US EU US EU

Contributors