@hookeasy/use-click

1.0.0 • Public • Published

@hookeasy/use-useClick

React Hook to update your useClick event

install

npm i @hookeasy/use-useClick

or

yarn add @hookeasy/use-useClick

example

import React, { useEffect, useRef } from "react";
import ReactDOM from "react-dom";
import useClick from "@hookeasy/use-click";

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

  const title = useClick(sayHello);

  return (
    <div className="App">
      <h1 ref={title}>HI</h1>
    </div>
  );
};

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

/@hookeasy/use-click/

    Package Sidebar

    Install

    npm i @hookeasy/use-click

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    2.69 kB

    Total Files

    5

    Last publish

    Collaborators

    • baram