react-alert icon indicating copy to clipboard operation
react-alert copied to clipboard

replaced useMemo with useCallback

Open sweeta-sinha opened this issue 5 years ago • 1 comments

sweeta-sinha avatar Sep 30 '20 13:09 sweeta-sinha

The previous pull request broke the alert.alerts list.

This pull request changes the value returned from useAlert from an object to a function, which is unnecessary and should be a caller side decision.

The correct way is to destructure the value returned from useAlert and put the show/error function in the dependency list of useEffect or useCallback rather than the returned value itself.

huan086 avatar Oct 29 '20 06:10 huan086