timolins / react-hot-toast

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

Toaster is not working in Next.js 13.5.3 #312

Closed shrikantpardhi closed 1 year ago

shrikantpardhi commented 1 year 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 1 year ago

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

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