react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast.configure is not a function

Viewed 1044

I'm trying to add toast notifications to my project. For some reason after adding

toast.configure();

code is not working and I have error:

react_toastify__WEBPACK_IMPORTED_MODULE_3__.toast.configure is not a function

error image

Here is my code:

import {toast} from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

toast.configure();

function App() {


return(
<div>
if(error){
toast.error("error message...!"); 
}
<div>
)
}

Why am I getting this error? I have installed toast-notifications.

Thank you in advance.

2 Answers

New version just came out. Try to install React Toastify by adding a specific version. In my case, 8.2.0 works.

- npm i react-toastify@8.2.0
- yarn add react-toastify@8.2.0
Related