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

1.0.0-rc.12 • Public • Published

Q React Hooks

A set of React hooks for Q Blockchain frontend projects.

npm npm min zipped size license pipeline status

Installation

To install the library, run the following command:

yarn add @q-dev/react-hooks

or

npm install @q-dev/react-hooks

Requirements

Usage

Importing

import { useInterval } from '@q-dev/react-hooks'

export default function App() {
  const [count, setCount] = useState(0)

  useInterval(() => {
    setCount(count + 1)
  }, 1000)

  return <div>{count}</div>
}

Hooks

Hook Description
useAnimateNumber Animate number from one value to another.
useChangesListener Listen for changes in the value.
useCopyToClipboard Copy text to clipboard.
useEventCallback useCallback for events.
useEventListener Event listener handlers.
useInfinityNumber Infinity number animation.
useInterval Call a function at a specified interval.
useLocalStorage Manage local storage.
useOnClickOutside Handle click outside of the element.
useOnScreen Detect if the element is visible on the screen.
useWindowSize Get window size.

Contribution

We welcome contributions to the library. If you would like to submit a pull request, please make sure to follow our code style.

Code of Conduct

This project and everyone participating in it is governed by the Q React Hooks Code of Conduct. By participating, you are expected to uphold this code.

Resources

License

LGPL-3.0

Readme

Keywords

none

Package Sidebar

Install

npm i @q-dev/react-hooks

Weekly Downloads

0

Version

1.0.0-rc.12

License

LGPL-3.0

Unpacked Size

420 kB

Total Files

87

Last publish

Collaborators

  • aostrun
  • tynuk
  • misterzett
  • tbltzk