Utility
useSessionStorage
Software Development Kits
[EVM] React Components SDK
- Overview
- Getting started
- Theming
- Wallet connect
- Framework Guides
- Page Components
- Block Components
[EVM] React Hooks SDK
[EVM] Core SDK
[EVM] Perp SDK
Utility
useSessionStorage
Utility hook to store values in browser’s session storage.
Example
const [needConfirm, setNeedConfirm] = useLocalStorage("CONFIRM_ORDER", true);
return (
<>
{/* ... */}
<label>
Confirm Order
<input
type="checkbox"
checked={needConfirm}
onChange={() => {
setNeedConfirm(!needConfirm);
}}
/>
</label>
</>
);
On this page