use-onclickoutside-ssr

1.0.1 • Public • Published

What is this?

useOutside Click Event on React JS projects and also NextJS project(for SSR)

Install

npm i use-onclickoutside-ssr --save

Then ...

import React, { useRef } from "react";
import useOnClickOutsideSSR from "use-onclickoutside-ssr";

const App = () => {
    const ref = useRef();
    useOnClickOutside(ref, () => console.log("clicked outside"));

    return (
        <div ref={ref}>
            Hello World
        </div>
    )
}

Package Sidebar

Install

npm i use-onclickoutside-ssr

Weekly Downloads

5

Version

1.0.1

License

ISC

Unpacked Size

1.85 kB

Total Files

3

Last publish

Collaborators

  • angularmast