Hey, I'm using next.js in my project, and I configure all loaders in the right way, but when I try to use the Toastr, it's coming without style.
Some tip about it?
Hello,
Do you import the css file at the root of your application? I had the same issue with nextjs with another library. I had to import the css at the root to solve my issue.
Below works for me
// pages/_app.js
import { ToastContainer, Slide } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.min.css';
const MyApp = ({ Component, pageProps }) => {
return (
<>
<Component {...pageProps} />
<ToastContainer
className="impct-toast"
position="top-center"
autoClose={3000}
hideProgressBar
newestOnTop
closeOnClick
rtl={false}
pauseOnVisibilityChange
draggable={false}
pauseOnHover
transition={Slide}
/>
</>
);
};
export default MyApp;
Most helpful comment
Below works for me