mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 14:38:45 +00:00
Merge pull request #125 from project-error/tweak/snackbar-provider
tweak(phone/snackbarprovider): remove redunant function
This commit is contained in:
1 file changed
+2
-4
@@ -11,15 +11,13 @@ function SnackbarProvider({ children }) {
|
||||
clearTimeout(timer.current);
|
||||
timer.current = setTimeout(() => {
|
||||
setAlert(null);
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
}
|
||||
return () => clearTimeout(timer.current);
|
||||
}, [alert]);
|
||||
|
||||
const addAlert = (value) => setAlert(value);
|
||||
|
||||
return (
|
||||
<SnackbarContext.Provider value={{ addAlert, alert }}>
|
||||
<SnackbarContext.Provider value={{ alert, addAlert: setAlert }}>
|
||||
{children}
|
||||
</SnackbarContext.Provider>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user