Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@kodai3/use-effect-once

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kodai3/use-effect-once

React lifecycle hook that runs an effect only once.

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

useEffectOnce

React lifecycle hook that runs an effect only once.

Usage

import { useEffectOnce } from "@kodai3/use-effect-once";

const Demo = () => {
  useEffectOnce(() => {
    console.log("Running effect once on mount");

    return () => {
      console.log("Running clean-up of effect on unmount");
    };
  });

  return null;
};

Reference

useEffectOnce((effect: EffectCallback));

Keywords

react

FAQs

Package last updated on 03 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts