Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brightleaf/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightleaf/react-hooks - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

package.json
{
"name": "@brightleaf/react-hooks",
"version": "0.2.2",
"version": "0.2.3",
"description": "Useful react hooks",

@@ -5,0 +5,0 @@ "files": [

@@ -17,3 +17,3 @@ # Brightleaf React Hooks

import React, { useState } from 'react'
import { useGraphQL } from '@brightleaf/hooks'
import { useGraphQL } from '@brightleaf/react-hooks'

@@ -47,3 +47,3 @@ export default () => {

import { Button, Form, TextBox } from 'react-form-elements'
import { usePost } from '@brightleaf/hooks'
import { usePost } from '@brightleaf/react-hooks'

@@ -116,2 +116,41 @@ export default () => {

)
}
}
```
## Click Outside Hook
```javascript
import React, { useState, useRef } from 'react'
import { useClickOutside } from '@brightleaf/react-hooks'
export default () => {
const [menu, setMenu] = useState(false)
const navMenu Ref= useRef()
const hideDropDown = () => {
setMenu(false)
}
useClickOutside(navMenu, hideDropDowns, menu)
return (
<div className="App">
<nav ref={navMenu}>
<div className={`dropdown ${menu ? 'active' : ' '}`}>
<button
type="button"
className="dropdown-trigger"
onClick={e => {
setMenu(!ddG)
}}
>
Menu
</button>
<div>
...// items
</div>
</div>
</nav>
... // rest of page
</div>
)
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc