Skip to content
usefy

useUpdateEffect

Lifecycle & refs

A useEffect variant that skips the first render

Install

$ npm install @usefy/use-update-effect

Quick start

useUpdateEffect.tsx
import { useUpdateEffect } from "@usefy/use-update-effect";

useUpdateEffect(() => {
  // runs only when `query` changes, not on mount
  search(query);
}, [query]);

API reference

useUpdateEffect(effect, deps?) — same as useEffect but does not run on the initial render.

Go deeper

This page is the quick reference. For every example, prop, and edge case, read the full README — or open Storybook to change props live.

More in lifecycle & refs