</>PackageGraphPackageGraph

use-latest-callback

npmv0.3.5TypeScript

React hook which returns the latest callback without changing the reference

Safe to adopt

Yes — use-latest-callback scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 45 days ago. 11 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 45 days ago. 11 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 5.6 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding use-latest-callback to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

5.6 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
No constraint declared
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the use-latest-callback README.

import useLatestCallback from 'use-latest-callback';

// ...

function MyComponent() {
  const callback = useLatestCallback((value) => {
    console.log('Changed', value);
  });

  React.useEffect(() => {
    someEvent.addListener(callback);

    return () => someEvent.removeListener(callback);
  }, [callback]);
Example truncated — see the full README.

use-latest-callback vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
use-latest-callbackthis page01MIT1 month ago
react152.8M82MIT1 day ago
react-dom143.7M47MIT1 day ago
react-style-singleton59.1M2MIT1 day ago
reselect44M1MIT1 day ago
next40.6M0MIT1 day ago

Dependencies

Declared by use-latest-callback v0.3.5. Runtime dependencies are installed with the package; dev dependencies are not.

Peer (1)

Dev (11)

@commitlint/config-conventional ^12.1.4@release-it/conventional-changelog ^7.0.2@types/react ^18.0.10commitlint ^12.1.4del-cli ^4.0.1eslint ^8.53.0eslint-config-satya164 ^3.2.0prettier ^3.0.3react ^17.0.2release-it ^16.2.1typescript ^5.2.2

Used by

Popular packages that depend on use-latest-callback.

Relationship graph

Dependencies (left) and dependents (right) of use-latest-callback.

reactreact-native-draw…use-latest-callba…
use-latest-callback dependencies dependents

Frequently installed together

Release history

9 releases in the last two years, typically about 21 days apart.

Recent versions of use-latest-callback
VersionPublishedSizeLicense
0.3.5latest1 month ago5.6 KBMIT
0.3.43 months ago6.2 KBMIT
0.3.39 months ago6.2 KBMIT
0.3.210 months ago6.2 KBMIT
0.3.111 months ago6.2 KBMIT
0.3.011 months ago5.6 KBMIT
0.2.611 months ago6.2 KBMIT
0.2.511 months ago6.2 KBMIT
0.2.41 year ago5.1 KBMIT
0.2.31 year ago5.9 KBMIT
0.2.21 year ago5.9 KBMIT
0.2.12 years ago5.9 KBMIT
0.2.02 years ago5.9 KBMIT
0.1.112 years ago7.0 KBMIT
0.1.102 years ago6.8 KBMIT

Overview

use-latest-callback is an npm package that react hook which returns the latest callback without changing the reference. It has 1 known dependents in the graph. The latest version is 0.3.5, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need react hook which returns the latest callback without changing the reference and value a focused solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use use-latest-callback?

Yes — use-latest-callback scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 45 days ago. 11 releases in the last 2 years.

How do I install use-latest-callback?

Run `npm install use-latest-callback` to add use-latest-callback to your npm project.

What license is use-latest-callback released under?

use-latest-callback is distributed under the MIT license.

How popular is use-latest-callback?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on use-latest-callback.

Is use-latest-callback still maintained?

The most recent release of use-latest-callback (v0.3.5) was published 1 month ago.

Does use-latest-callback run install scripts?

No. use-latest-callback does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.