New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-hook-house

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hook-house

A house of useful react hooks

latest
npmnpm
Version
0.0.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

React Hook House

A house of useful react hooks.



Get started

To add React Hook House to your project.

pnpm install react-hook-house


Examples

useOutsideClick

"use client";
import React, { useRef, useState } from "react";
import { useOutsideClick } from "react-hook-house";

export default function App() {
  const [isOpen, setIsOpen] = useState(false);
  const modal = useRef(null);

  const handleClick = () => setIsOpen((pre) => !pre);

  userOutsideClick([modal], isOpen, handleClick);

  return (
    <div className="container">
      {isOpen ? (
        <div className="modal" ref={modal}>
          <div className="user">
            <h2 className="userName">Example</h2>
            <img className="userImage" src="/user-img.jpg" />
          </div>
        </div>
      ) : (
        <></>
      )}
      <button className="button" onClick={handleClick}>
        Show User
      </button>
    </div>
  );
}

Keywords

react-house

FAQs

Package last updated on 11 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts