@ian_test_nooks/use-click

1.0.2 • Public • Published

@ian_test_nooks/use-click

React Hook to catch event when click element

npm i @ian_test_nooks/use-click

const useRef = useClick(callback function);

import useClick from "@ian_test_nooks/use-click";

const App = () => {
  const sayHello = () => console.log("Hello");

  const title = useClick(sayHello);
  return (
    <div className="App">
      <h1 ref={title}>Hi</h1>
      <input placeholder="la" />
    </div>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i @ian_test_nooks/use-click

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

1.73 kB

Total Files

4

Last publish

Collaborators

  • iian