modali icon indicating copy to clipboard operation
modali copied to clipboard

Memoize toggle function

Open Velenir opened this issue 5 years ago • 0 comments

Currently toggle function is created anew on each render. If later passed as a prop to a component it can cause unnecessary rerenders.

Memoizing toggle with useCallback would avoid that

Velenir avatar Mar 03 '20 09:03 Velenir