Fork of https://github.com/dance2die/react-use-localstorage but then uses session storage instead of local storage.
importReactfrom'react';importReactDOMfrom'react-dom';importuseLocalStoragefrom'react-use-sessionstorage';import'./styles.css';functionApp(){const[item,setItem]=useSessionStorage('name','Initial Value');return(<divclassName="App"><h1>Set Name to store in Local Storage</h1><div><label>
Name:{' '}<inputtype="text"placeholder="Enter your name"value={item}onChange={e=>setItem(e.target.value)}/></label></div></div>);}constrootElement=document.getElementById('root');ReactDOM.render(<App/>,rootElement);