react-justu
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-justu

A cool library that contains set of tools for common implementations

Installation

Using npm:

$ npm i react-justu --save-dev

Using yarn:

$ yarn add -D react-justu

Usage

import { useRef } from "react";
import { useClickOutside } from "react-justu";

export const MyComponent = () => {
  const wrapperRef = useRef(null);

  const doSomething = () => {
    alert("hello");
  };
  useClickOutside(wrapperRef, doSomething);

  return (
    <div>
      <div ref={wrapperRef}>Click outside</div>
    </div>
  );
};

Package Sidebar

Install

npm i react-justu

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

5.08 kB

Total Files

10

Last publish

Collaborators

  • dexkode