fkhadra / react-toastify

React notification made easy 🚀 !
https://fkhadra.github.io/react-toastify/introduction
MIT License
12.58k stars 692 forks source link

TypeError: Object(...) is not a function #502

Closed ahmedalmory closed 4 years ago

ahmedalmory commented 4 years ago

I get this error once I use ToastContainer Component and my app doesn't work when I remove ToastContainer everything works fine

0

WhyRoy commented 4 years ago

I encountered this issue too, and I don't know why. So i just instal the 4.0.1 version of react-toastify, then everything works. Does any friend could tell me the exact reason that I can use 6.0.6 version? and are there any better ways to fix this issue?

fkhadra commented 4 years ago

This seems like a bundler issue. Could you share what you use to build your app ?

WhyRoy commented 4 years ago

thank u for replying, sorry to say I am a beginner, I am a little confused by "what you use to ...", I am build a react app, and I use npm to install react-toastify

fkhadra commented 4 years ago

Did you use something like create-react-app to bootstrap your application or do you use a custom webpack configuration?

WhyRoy commented 4 years ago

Thx for ur patience, actually, I downloaded from a courses' provide, and I tested just now on another app which I built use "creact-react-app", everything with react-toastify works perfectly. So I think it's the courses' app that has some problem. Thanks

fkhadra commented 4 years ago

Ok thanks for you feedback. I'll close the issue then :)

darmawan01 commented 3 years ago

same issues here, adding to my existing app

my dependency

"dependencies": {
    "@react-pdf/renderer": "1.1.1",
    "admin-lte": "2.4.8",
    "async": "2.6.1",
    "axios": "0.18.0",
    "bootstrap": "4.1.1",
    "chart.js": "2.7.2",
    "connected-react-router": "4.3.0",
    "date-fns": "1.29.0",
    "debounce": "1.2.0",
    "downloadjs": "1.4.7",
    "faker": "4.1.0",
    "flatpickr": "4.4.7",
    "fullcalendar-reactwrapper-cdl": "1.0.9",
    "hash.js": "1.1.5",
    "hex.js": "1.0.1",
    "json-loader": "0.5.7",
    "jwt-decode": "2.2.0",
    "lorem-ipsum": "2.0.1",
    "morris.js": "github:morrisjs/morris.js",
    "multiselect-react-dropdown": "^1.6.1",
    "print-js": "^1.0.61",
    "qr-image": "3.2.0",
    "qs": "6.5.2",
    "rc-checkbox": "2.1.5",
    "react": "16.4.0",
    "react-avatar-edit": "0.8.2",
    "react-chartjs-2": "2.7.2",
    "react-dom": "16.4.0",
    "react-drag-list": "1.1.0",
    "react-easy-crop": "^1.16.1",
    "react-favicon": "0.0.14",
    "react-flatpickr": "3.6.4",
    "react-ga": "^2.6.0",
    "react-icons": "2.2.7",
    "react-idle-timer": "4.1.3",
    "react-janus": "0.1.1",
    "react-pdf-js": "4.0.2",
    "react-redux": "5.0.7",
    "react-router-dom": "4.2.2",
    "react-scripts": "3.1.1",
    "react-switch": "3.0.4",
    "react-tinymce": "0.7.0",
    "react-toastify": "^6.2.0",
    "react-tooltip": "^3.11.1",
    "react-virtualized": "^9.21.2",
    "redux": "4.0.0",
    "redux-thunk": "2.3.0",
    "reselect": "4.0.0",
    "sweetalert-react": "0.4.11",
    "uuid": "3.3.2",
    "uuid-validate": "0.0.3",
    "workbox-cli": "4.3.1"
  },

any solution ? thanks for your help

chr4ss1 commented 3 years ago

useReducer was added in react 16.8.0, ensure you are using that version or higher