1.0.1 • Published 4 years ago

use-onclickoutside-ssr v1.0.1

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

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>
    )
}