Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed May 13, 2024
1 parent 8032766 commit 177a590
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ you pass a memoized callback:
```ts
// option 2:
// ...
const increment = useMemoCallback(() => setCount(c => c + step), [step])
const increment = useCallback(() => setCount(c => c + step), [step])
const debouncedIncrement = useDebounce(increment, 3000)
// ...
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function App() {

// 🦉 feel free to swap these two implementations and see they don't make
// any difference to the user experience
// const increment = useMemoCallback(() => setCount(c => c + step), [step])
// const increment = useCallback(() => setCount(c => c + step), [step])
const increment = () => setCount(c => c + step)
const debouncedIncrement = useDebounce(increment, 3000)
return (
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 177a590

Please sign in to comment.