Skip to content

Instantly share code, notes, and snippets.

View turdiyev's full-sized avatar
🙂
Uzbek Developer

Sheralijon turdiyev

🙂
Uzbek Developer
View GitHub Profile
import { useState, useEffect } from 'react';
// Usage
function App() {
// Similar to useState but we pass in a key to value in local storage
// With useState: const [name, setName] = useState('Bob');
const [name, setName] = useLocalStorage('name', 'Bob');
return (
<div>