Skip to content

Commit

Permalink
fix: next build error (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Jan 15, 2025
1 parent 2ba410f commit ba9feb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -354,7 +354,7 @@ const Toast = (props: ToastProps) => {
</button>
) : 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' ? (
Expand Down Expand Up @@ -389,7 +389,7 @@ const Toast = (props: ToastProps) => {
</div>
) : null}
</div>
{React.isValidElement(toast.cancel) ? (
{isValidElement(toast.cancel) ? (
toast.cancel
) : toast.cancel && isAction(toast.cancel) ? (
<button
Expand All @@ -408,7 +408,7 @@ const Toast = (props: ToastProps) => {
{toast.cancel.label}
</button>
) : null}
{React.isValidElement(toast.action) ? (
{isValidElement(toast.action) ? (
toast.action
) : toast.action && isAction(toast.action) ? (
<button
Expand Down

0 comments on commit ba9feb6

Please sign in to comment.