modali
modali copied to clipboard
Memoize toggle function
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