Skip to content

An opinionated toast component for React.

[Docs]: Render toast on page load (#363)

Luís Viegas6b37985d33b7
diff --git a/website/src/pages/toast.mdx b/website/src/pages/toast.mdx
index 3a23263..085903c 100644
--- a/website/src/pages/toast.mdx
+++ b/website/src/pages/toast.mdx
@@ -27,6 +27,16 @@ toast('My toast', {
});
```
+### Render toast on page load
+
+To render a toast on initial page load it is required that the function `toast()` is called inside of a `setTimeout` or `requestAnimationFrame`.
+
+```jsx
+setTimeout(() => {
+ toast('My toast on a page load');
+})
+```
+
## Creating toasts
### Success