teodosii / react-notifications-component

Delightful and highly customisable React Component to notify your users
https://teodosii.github.io/react-notifications-component/
MIT License
1.28k stars 73 forks source link

TypeError: this.add is not a function #179

Open rajeevvishva opened 10 months ago

rajeevvishva commented 10 months ago

Getting error : TypeError: this.add is not a function

react": "^18.2.0", "react-dom": "^18.2.0", "react-notifications-component": "^4.0.1", "react-router-dom": "^6.21.1",

aaronrhodes commented 10 months ago

is this in a unit test? I had to add a element to my render method which solved this issue. Otherwise might need one in the app root 👍

gabrielhpugliese commented 1 month ago

@aaronrhodes what do you mean about "add a element to my render method"? I am having the same error

aaronrhodes commented 1 month ago

@aaronrhodes what do you mean about "add a element to my render method"? I am having the same error

Oh sorry that was quite vague! Add a ReactNotifications element to your unit test render method alongside whatever you're testing.

Just realised what happened to my first comment - the html is being stripped out