/ live.thehmm.nl / back / node_modules / use-isomorphic-layout-effect /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]dist/2 years ago -  
[   ]LICENSE40 years ago1.0K 
[TXT]README.md40 years ago625 d7c1522 post receive test [كارل مبارك]
[   ]package.json2 years ago2.7K 
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
  }, []);
};
Apache/2.4.38 (Debian) Server at www.karls.computer Port 80