npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vishwaraviraaj/react-hooks

v1.1.2

Published

This library provides a collection of useful React hooks to enhance your development experience. The hooks cover various functionalities, including API fetching, state management, lifecycle logging, and more.

Downloads

6

Readme

React Custom Hooks Library

This library provides a collection of useful React hooks to enhance your development experience. The hooks cover various functionalities, including API fetching, state management, lifecycle logging, and more.

Installation

You can install the package using npm:

npm install @vishwaraviraaj/react-hooks

Or using yarn:

yarn add @vishwaraviraaj/react-hooks

Hooks Documentation

1. useVirtualList

Efficiently renders large lists by virtualizing the elements.

const { visibleItems, containerRef } = useVirtualList(items, itemHeight, containerHeight);

2. useFetchParallel

Fetch multiple APIs in parallel and manage loading/error states.

const { data, loading, error } = useFetchParallel([url1, url2, ...]);

3. useFetch

General-purpose hook for fetching data from an API.

const { data, loading, error } = useFetch(url);

4. useLocalStorage

Persists state in local storage.

const [value, setValue] = useLocalStorage("key", "defaultValue");

5. usePrevious

Gets the previous value of a state or prop.

const prevValue = usePrevious(value);

6. useComponentLifecycleLogger

Logs component mount and unmount events.

useComponentLifecycleLogger("ComponentName");

7. useNetworkStatus

Detects online/offline network status.

const isOnline = useNetworkStatus();

8. useUndoRedo

Adds undo/redo functionality for state management.

const { state, set, undo, redo, canUndo, canRedo } = useUndoRedo(initialState);

9. useQueue

Manages a queue data structure.

const { queue, enqueue, dequeue } = useQueue();

10. useCSSVariables

Dynamically updates CSS variables.

useCSSVariables({"--main-color": "red", ...});

11. useGetRequest

Fetches data using a GET request.

const { data, loading, error } = useGetRequest(url);

12. usePostRequest

Performs a POST request.

const { data, postRequest, loading, error } = usePostRequest(url);
postRequest(payload);

13. usePutRequest

Performs a PUT request.

const { data, putRequest, loading, error } = usePutRequest(url);
putRequest(payload);

14. useDeleteRequest

Performs a DELETE request.

const { data, deleteRequest, loading, error } = useDeleteRequest(url);
deleteRequest();

15. useTrigger

Triggers a callback when a condition is met.

useTrigger(() => console.log("Triggered!"), condition);

16. useSharedState

Shares state across different components.

const [value, setValue] = useSharedState("sharedKey", "Initial Value");

Contributing

Feel free to contribute to this library by submitting a pull request.

License

MIT License.