1.0.0 • Published 5 years ago

@hookeasy/use-click v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@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);