🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@del-wang/react-unstrict

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@del-wang/react-unstrict

✂️ Bypass React StrictMode double execution for consistent development behavior

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
10
100%
Maintainers
1
Weekly downloads
 
Created
Source

@del-wang/react-unstrict

✂️ Bypass React StrictMode double execution for consistent development behavior.

Why?

React StrictMode double-invokes effects in development to detect side effects. This package ensures your code runs only once, maintaining consistency between development and production.

Installation

npm install @del-wang/react-unstrict

Get Started

useUnStrictEffect

import { useUnStrictEffect } from "@del-wang/react-unstrict";

function Component() {
  useUnStrictEffect(() => {
    // Runs once, even in StrictMode
    console.log("API call");
    return () => console.log("Cleanup");
  }, []);

  return <div>Component</div>;
}

useUnStrictRun

import { useUnStrictRun } from "@del-wang/react-unstrict";

function Component() {
  useUnStrictRun(() => {
    // Runs once per build, even though React calls build twice in dev mode
    console.log("Build logic executed");
  });

  return <div>Component</div>;
}

License

MIT © Del Wang

Keywords

react

FAQs

Package last updated on 28 Jan 2026

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