@nanlabs/react-hooks
TypeScript icon, indicating that this package has built-in type declarations

0.5.5 • Public • Published

React Hooks

Documentation | Contributing

Continious Integration npm npm License: MIT

This package contains multiple hooks that can be used in your React application!

Installation

npm install @nanlabs/react-hooks

Usage

The following example shows how one of the multiple hooks provided by this library can be used.

In the example bellow we use useDebounce to debounce the value of an input.

You can find more examples in the documentation.

import React, { useState } from "react";
import { useDebounce } from "@nanlabs/react-hooks";

const Component = () => {
  const [value, setValue] = useState("");
  const debouncedValue = useDebounce(value, 500);

  return (
    <div>
      <input value={value} onChange={(e) => setValue(e.target.value)} />
      <p>Debounced value: {debouncedValue}</p>
    </div>
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @nanlabs/react-hooks

Weekly Downloads

36

Version

0.5.5

License

MIT

Unpacked Size

41.1 kB

Total Files

5

Last publish

Collaborators

  • ulises-jeremias
  • nanlabs1