Skip to content

purskills/useOnClickOutsideSSR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

useOnClickOutside on SSR and NextJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published