react-cool-onclickoutside
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "react-cool-onclickoutside", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "React hook to listen for clicks outside of the component(s).", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -43,3 +43,3 @@ # React Cool Onclickoutside | ||
const [openMenu, setOpenMenu] = useState(false); | ||
const rigisterRef = useOnclickoutside(() => { | ||
const registerRef = useOnclickoutside(() => { | ||
setOpenMenu(false); | ||
@@ -55,3 +55,3 @@ }); | ||
<div onClick={handleClickBtn}>Button</div> | ||
{openMenu && <div ref={rigisterRef}>Menu</div>} | ||
{openMenu && <div ref={registerRef}>Menu</div>} | ||
</div> | ||
@@ -69,3 +69,3 @@ ); | ||
const [showTips, setShowTips] = useState(true); | ||
const rigisterRef = useOnclickoutside(() => { | ||
const registerRef = useOnclickoutside(() => { | ||
setShowTips(false); | ||
@@ -78,4 +78,4 @@ }); | ||
<> | ||
<Tooltip ref={rigisterRef} /> | ||
<Tooltip ref={rigisterRef} /> | ||
<Tooltip ref={registerRef} /> | ||
<Tooltip ref={registerRef} /> | ||
</> | ||
@@ -91,3 +91,3 @@ )} | ||
```js | ||
const rigisterRef = useOnclickoutside(callback[, options]); | ||
const registerRef = useOnclickoutside(callback[, options]); | ||
``` | ||
@@ -94,0 +94,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package