API Reference
Advanced Tutorials
Comparison
FAQ
Contributing
Testing
Migration Guide
Licence
This is documentation for Refine 3.xx.xx, which is no longer actively maintained.
For up-to-date documentation, see the latest version (4.xx.xx).
Version: 3.xx.xx
basic-usage-live-preview
localhost:3000/products
Live previews only work with the latest documentation.
import { useNotification } from "@pankod/refine-core";
import { Button, Stack } from "@pankod/refine-mui";
const ExamplePage: React.FC = () => {
const { open, close } = useNotification();
return (
<Stack spacing={2} direction="row">
<Button
color="success"
variant="outlined"
size="small"
onClick={() =>
open?.({
type: "success",
message: "Success",
description: "Success description",
})
}
>
Success
</Button>
<Button
color="error"
variant="outlined"
size="small"
onClick={() =>
open?.({
type: "error",
message: "Error",
description: "Error description",
})
}
>
Error
</Button>
<Button
color="secondary"
variant="outlined"
size="small"
onClick={() =>
open?.({
type: "progress",
message: "Progress",
undoableTimeout: 5,
cancelMutation: () => {
alert("cancelMutation")
}
})
}
>
Progress
</Button>
</Stack>
);
};