diff --git a/stories/useLatest.story.tsx b/stories/useLatest.story.tsx index 6c2969b5..642e331c 100644 --- a/stories/useLatest.story.tsx +++ b/stories/useLatest.story.tsx @@ -6,18 +6,19 @@ import ShowDocs from './util/ShowDocs'; const Demo = () => { const [count, setCount] = React.useState(0); const latestCount = useLatest(count); + const timeoutMs = 3000; function handleAlertClick() { setTimeout(() => { alert(`Latest count value: ${latestCount.current}`); - }, 3000); + }, timeoutMs); } return (

You clicked {count} times

- +
); };