import React from "react"
import useSavedState from "./useSavedState"
const AnnoyingPopUp = () => {
const [isShown, setIsShown] = useSavedState(true)
const hide = () => setIsShown(false)
return (
<>
{isShown &&
<>
<p>This is modal</p>
<button onClick={hide}>Close modal</button>
</>
}
</>
)
}
export default AnnoyingPopUp
-
Notifications
You must be signed in to change notification settings - Fork 0
craftystudio/useSavedState
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Save react state to localStorage
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published