From ba9feb6d8f074dba9fc7fa9b8b81355f4c409a4b Mon Sep 17 00:00:00 2001
From: Emil Kowalski <36730035+emilkowalski@users.noreply.github.com>
Date: Wed, 15 Jan 2025 02:41:37 +0100
Subject: [PATCH] fix: next build error (#538)
---
src/index.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/index.tsx b/src/index.tsx
index dbcca73..19cdfe1 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import React, { forwardRef } from 'react';
+import React, { forwardRef, isValidElement } from 'react';
import ReactDOM from 'react-dom';
import { CloseIcon, getAsset, Loader } from './assets';
@@ -354,7 +354,7 @@ const Toast = (props: ToastProps) => {
) : null}
{/* TODO: This can be cleaner */}
- {toast.jsx || React.isValidElement(toast.title) ? (
+ {toast.jsx || isValidElement(toast.title) ? (
toast.jsx ? (
toast.jsx
) : typeof toast.title === 'function' ? (
@@ -389,7 +389,7 @@ const Toast = (props: ToastProps) => {
) : null}
- {React.isValidElement(toast.cancel) ? (
+ {isValidElement(toast.cancel) ? (
toast.cancel
) : toast.cancel && isAction(toast.cancel) ? (
) : null}
- {React.isValidElement(toast.action) ? (
+ {isValidElement(toast.action) ? (
toast.action
) : toast.action && isAction(toast.action) ? (