how to re render react re usabelcomponent
So I have an resusable component for Toaster notification with message , color property for now I only make with message
So In that Toaster , it contains message and close icon button so whenever I click the toaster would go off (false) but whenever I get message propes I set useEffect with setShow true
So the problem is if I get same message again
It doesn't show the toaster
Toaster.jsx
Home.jsx
1 Reply
So if I get same message for 2nd time continuously , the useEffect on toaster doesn't run due to dependency ,
Can I get any ideas or solutions?? Cuz I need to use this as resusable