Skip to main content
Home

Built and signed on GitHub Actions

A group of react hooks that makes life easier.

This package works with BrowsersIt is unknown whether this package works with Node.js
It is unknown whether this package works with Node.js
This package works with Browsers
JSR Score
82%
Published
7 months ago (0.1.9)

React Hooks

A group of react hooks that makes life easier.

This package currently include the following hooks, more hooks may be added in the future.

  • useAsyncData Asynchronously load remote data, usually used with fetch API.
  • useDebouncedCallback Returns a debounced function that can be used to reduce unnecessary calls.
  • usePropState Uses a prop as the state in a component, and when the prop changes, the state will change accordingly.
  • useRerender Returns a rerender function that can be used to trigger a rerender of the component manually.
  • useRevertibleState Adds additional functions to the useState hook, allowing us to undo and redo state changes.
  • useRouter Manipulates route and retrieving route parameters.
  • useSubmit Submit data to a remote server and track the status of the request.
  • useStorageState Similar to useState, but persist the state to the localStorage (by default) or sessionStorage.
  • useUrlState Similar to useState, but persist the state to the URL query parameters.
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

pnpm i jsr:@ayonli/react-hooks
or (using pnpm 10.8 or older)
pnpm dlx jsr add @ayonli/react-hooks

Import symbol

import * as react_hooks from "@ayonli/react-hooks";

Add Package

yarn add jsr:@ayonli/react-hooks
or (using Yarn 4.8 or older)
yarn dlx jsr add @ayonli/react-hooks

Import symbol

import * as react_hooks from "@ayonli/react-hooks";

Add Package

vlt install jsr:@ayonli/react-hooks

Import symbol

import * as react_hooks from "@ayonli/react-hooks";

Add Package

npx jsr add @ayonli/react-hooks

Import symbol

import * as react_hooks from "@ayonli/react-hooks";