Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-isomorphic-layout-effect

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-isomorphic-layout-effect - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

package.json
{
"name": "use-isomorphic-layout-effect",
"version": "1.1.1",
"version": "1.1.2",
"description": "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).",

@@ -31,3 +31,3 @@ "main": "dist/use-isomorphic-layout-effect.cjs.js",

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},

@@ -34,0 +34,0 @@ "peerDependenciesMeta": {

# 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
```sh
$ npm i use-isomorphic-layout-effect
```
## Usage
You only need to switch `useLayoutEffect` with `useIsomorphicLayoutEffect`
```diff
+ import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';
- import { useLayoutEffect } from 'react';
const YourComponent = () => {
+ useIsomorphicLayoutEffect(() => {
- useLayoutEffect(() => {
// your implementation
}, []);
};
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc