timolins / react-hot-toast

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

Getting "Did not expect server HTML to contain a <div> in <div>" when adding Toaster to _app.tsx #156

Closed 1rens1 closed 2 years ago

1rens1 commented 2 years ago

I added the <Toaster> component to the _app.tsx file. When I reload and checked the logs, it shows the Did not expect server HTML to contain a <div> in <div> error.

My _app.tsx:

import '@styles/globals.scss';
import { Toaster } from 'react-hot-toast';
import type { AppProps } from 'next/app';

export default function App({ Component, pageProps }: AppProps) {
    return (
        <>
            <Toaster
                toastOptions={{
                    style: {
                        background: '#222222',
                        color: '#ffffff',
                        borderRadius: '10px',
                    },
                }}
            />
            <Component {...pageProps} />
        </>
    );
}
1rens1 commented 2 years ago

Turns out just needed to restart the server....