timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.44k stars 309 forks source link

Toaster is not working in Next.js 13.5.3 #312

Closed shrikantpardhi closed 9 months ago

shrikantpardhi commented 9 months ago

I tried below example also.

import toast, { Toaster } from 'react-hot-toast';

const notify = () => toast('Here is your toast.');

const App = () => {
  const handle = () => {
      () => notify();
  }
  return (
    <div>
      <button onClick={handle}>Make me a toast</button>
      <Toaster />
    </div>
  );
};

I am not getting errors.

shrikantpardhi commented 9 months ago

Resolved the issue, I used the below code and it worked.

const handle = () => {
     toast('Here is your toast.');
}