By default, a progress bar is shown to indicate the time before the snackbar is removed. This can be done in one of two ways:
progressBar
prop on the SnackbarProvider
to false
to disable for all snackbarsprogressBar
property on the object passed to createSnackbar
to false
to disable for a specific snackbarimport React from 'react';
import { SnackbarProvider, wrapComponent } from 'react-snackbar-alert';
export default function NoProgressBarExample() {
return (
<SnackbarProvider progressBar={false}>
<Container />
</SnackbarProvider>
);
}
const Container = wrapComponent(function({ createSnackbar }) {
function showSnackbar() {
createSnackbar({
message: 'Hello Snackbar!'
});
}
return (
<div>
<button onClick={showSnackbar}>Show Snackbar</button>
</div>
);
});