Implementation in react redux - css not loading
See original GitHub issueDo 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
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
class App extends React.Component {
render () {
return (
<div>
<ToastContainer />
<!-- Other containers -->
</div>
);
}
}
/* Rest of the App.js file */
actions.js
import { toast } from 'react-toastify';
export const UNIFIED_SEARCH_START = 'UNIFIED_SEARCH_START';
export function unifiedSearchStart () {
toast.success('Unified search start');
return {
type: UNIFIED_SEARCH_START,
payload: true
};
}
export function unifiedSearch (terms) {
return dispatch => {
dispatch(unifiedSearchStart());
/* do other things here */
}
}
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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top GitHub Comments
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.added
import "react-toastify/dist/ReactToastify.css";
. it all works. 😃 sorry to bother about this