Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const TestComponent = () => {
- const [timesPressed, setTimesPressed, isLoadingTimesPressed, err] = useClientStorage('totalButtonPresses', 0);
- return (
- <div>
- <div><button onClick={() => setTimesPressed(timesPressed + 1)}>Click Me</button></div>
- <div>Total presses: {isLoadingTimesPressed ? 'loading from local storage...' : timesPressed}</div>
- </div>
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement