0.5.5 • Published 6 months ago

@nanlabs/react-hooks v0.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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>
  );
};
0.5.4

7 months ago

0.5.5

6 months ago

0.5.3

12 months ago

0.5.2

12 months ago

0.5.1

1 year ago