diff --git a/.changeset/many-monkeys-deliver.md b/.changeset/many-monkeys-deliver.md
new file mode 100644
index 0000000000..d03af30531
--- /dev/null
+++ b/.changeset/many-monkeys-deliver.md
@@ -0,0 +1,7 @@
+---
+'@rocket.chat/fuselage-toastbar': patch
+---
+
+Enable compatibility with React 18
+
+React 18's Strict Mode fires effects twice, which breaks Fuselage's toast bar portal.
diff --git a/packages/fuselage-toastbar/src/ToastBar.stories.tsx b/packages/fuselage-toastbar/src/ToastBar.stories.tsx
index 9eeab41cac..29da4cf5ea 100644
--- a/packages/fuselage-toastbar/src/ToastBar.stories.tsx
+++ b/packages/fuselage-toastbar/src/ToastBar.stories.tsx
@@ -53,85 +53,51 @@ export const Default: StoryFn = () => {
);
};
-export const TopStart: StoryFn = () => {
+const Template: StoryFn<{
+ position: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
+}> = ({ position }) => {
const dispatchToastMessage = useToastBarDispatch();
- const handleDispatch = () =>
- dispatchToastMessage({
- type: 'success',
- message: DEFAULT_MESSAGE,
- position: 'top-start',
- });
-
useEffect(() => {
- handleDispatch();
- }, []);
-
- return (
-
- );
-};
-
-export const TopEnd: StoryFn = () => {
- const dispatchToastMessage = useToastBarDispatch();
-
- const handleDispatch = () =>
dispatchToastMessage({
type: 'success',
message: DEFAULT_MESSAGE,
+ position,
});
-
- useEffect(() => {
- handleDispatch();
- }, []);
+ }, [dispatchToastMessage, position]);
return (
-