Closed trekiteasy closed 5 years ago
This is also happening to me. If I use just toast
then nothing appears on the screen at all. If I use ToastContainer
then plain text gets rendered on the page where the container is.
My app is built using the latest versions of create-react-app and redux.
same here; the strange thing is that close button actually renders with correct css
Hello,
Could you reproduce the issue on codesanbox?
Did you render the ToastContainer
at the root of your app ? Where did you import the css?
Thanks
added import "react-toastify/dist/ReactToastify.css";
.
it all works. :)
sorry to bother about this
Did you render the
ToastContainer
at the root of your app ? Where did you import the css?
Yes, ToastContainer is rendered at the root of my app (as in App.js above). I import the css only in App.js (as above), in the same file containing my ToastContainer.
Hello, i have the same problems.
UPDATE: I resolved this problems. Need to split css modules from just import styles.
Here good article on this theme: https://medium.freecodecamp.org/how-i-integrated-css-modules-with-scss-into-my-react-application-32f473e1bb51
@RenatRysaev I think you nailed it... but you lost me at the same time ! Could you give a bit more detail on what you actually did and in which files ? Thanks in advance !
The import will not work with css-loader in place. You should import it where you have your global css loaded.
I did @import '../node_modules/react-toastify/dist/ReactToastify.min.css';
in my global css so that it is unescaped from CSS modules.
I'll close the issue since it's more related to build tools than the lib itself.
Do you want to request a feature or report a bug? This is probably more about me not integrating correctly in a redux react app ? (Even though I looked at your example and feel I'm doing exactly what you are doing...
What is the current behavior? The Toast css isn't loaded at all (I need to write the css class myself with position: fixed and z-index: 9999 in order to see it - styleless).
The app has a search bar and I was willing to open a toast when a search starts. The toast is here (in the DOM), but without CSS it is not visible unless I write a custom css class. What I am missing ?
The code :
App.js
/ Rest of the App.js file /
actions.js
What is the expected behavior? Was expecting to have the css with this
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? react 16.3.2 - chrome - MacOS