Utility
useLocalStorage
Software Development Kits
[EVM] React Components SDK
- Overview
- Getting started
- Configuration
- Theming
- Wallet connect
- Framework Guides
- Page Components
- Block Components
[EVM] React Hooks SDK
[EVM] Core SDK
[EVM] Perp SDK
Utility
useLocalStorage
Utility hook to store values in browser’s local 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