devs-coffee / frontend-collab-chat-project

frontend for the collaborative project of a chat app
MIT License
3 stars 0 forks source link

Snackbar logic repeat problem #82

Closed Jerome-Marichez closed 1 year ago

Jerome-Marichez commented 1 year ago

https://github.com/devs-coffee/frontend-collab-chat-project/blob/b4ac583d6513ea63a38cf352ecd37936e5494bf3/src/components/Auth/Login/Login.tsx#L22-L27

https://github.com/devs-coffee/frontend-collab-chat-project/blob/b4ac583d6513ea63a38cf352ecd37936e5494bf3/src/components/Auth/Login/Login.tsx#L77-L82

The snackbar utilizes the function "handleToastClose" repeatedly throughout the project.

Instead of repeatedly writing "handleToastClose," the component should receive a prop named "handleToastClose," which should be a callback function of the type React.dispatch<React.SetStateAction>.