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

@nextui-org/use-is-mounted

Package Overview
Dependencies
Maintainers
1
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextui-org/use-is-mounted - npm Package Compare versions

Comparing version 0.0.0-dev-v2-20230328184744 to 0.0.0-dev-v2-20230329200753

1

dist/index.d.ts
type UseIsMountedProps = {
rerender?: boolean;
delay?: number;
};

@@ -4,0 +5,0 @@ declare function useIsMounted(props?: UseIsMountedProps): (boolean | (() => boolean))[];

@@ -28,3 +28,3 @@ "use strict";

function useIsMounted(props = {}) {
const { rerender = false } = props;
const { rerender = false, delay = 0 } = props;
const isMountedRef = (0, import_react.useRef)(false);

@@ -34,4 +34,11 @@ const [isMounted, setIsMounted] = (0, import_react.useState)(false);

isMountedRef.current = true;
let timer = null;
if (rerender) {
setIsMounted(true);
if (delay > 0) {
timer = setTimeout(() => {
setIsMounted(true);
}, delay);
} else {
setIsMounted(true);
}
}

@@ -43,2 +50,5 @@ return () => {

}
if (timer) {
clearTimeout(timer);
}
};

@@ -45,0 +55,0 @@ }, [rerender]);

2

package.json
{
"name": "@nextui-org/use-is-mounted",
"version": "0.0.0-dev-v2-20230328184744",
"version": "0.0.0-dev-v2-20230329200753",
"description": "This hook can be used to render client-based components or run client logic",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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