Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const useSnackbar = () => {
const ui = useUi();
return {
showSnackbar: (message, options) => {
ui.setState(ui => {
return { ...ui, snackbar: { message, options } };
});
},
hideSnackbar: () => {
ui.setState(ui => {
return { ...ui, snackbar: null };
});
}
};
};
export const useSnackbar = () => {
const ui = useUi();
return {
showSnackbar: (message, options) => {
ui.setState(ui => {
return { ...ui, snackbar: { message, options } };
});
},
hideSnackbar: () => {
ui.setState(ui => {
return { ...ui, snackbar: null };
});
}
};
};