teodosii / react-notifications-component

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

TypeError: this.add is not a function #119

Closed ALi-Hosseinzad closed 3 years ago

ALi-Hosseinzad commented 3 years ago

followed the steps on the NPM page for react-notifications-component but I keep getting "TypeError: this.add is not a function".

Steps:

Install using npm install react-notifications-component.
Install animate.css using npm install animate.css.
Import react-notifications-component and store.

However, I just keep getting a TypeError: this.add is not a function

import "animate.css/animate.min.css";
import "react-notifications-component/dist/theme.css";
import { store } from "react-notifications-component";

export const notification = (title = "", type, message = "") => {
  return store.addNotification({
    title: title,
    type: type,
    message: message,
    insert: "top",
    container: "top-left",
    animationIn: ["animate__animated", "animate__fadeIn"],
    animationOut: ["animate__animated", "animate__fadeOut"],
    dismiss: {
      duration: 3000,
      onScreen: true,
    },
  });
};
DennieMello commented 3 years ago

i have the same problem

Снимок экрана 2021-07-29 в 16 37 06 Снимок экрана 2021-07-29 в 16 37 12
Jonas-Args commented 3 years ago

Have you guys added this <ReactNotification /> in your application?

Placeblock commented 3 years ago

Same Problem Here (I have added <ReactNotification />)

ALi-Hosseinzad commented 3 years ago

Have you guys added this <ReactNotification /> in your application?

yes, I added and it was resolved, thank you