how to add notification in next js

To need to install the node module in the project folder using the command

npm i react-toastify

import React from 'react';

  import { ToastContainer, toast } from 'react-toastify';
  import 'react-toastify/dist/ReactToastify.css';
  
  function App(){
    const notify = () => toast("Wow so easy!");

    return (
      <div>
        <button onClick={notify}>Notify!</button>
        <ToastContainer />
      </div>
    );
  }

Leave a comment

Your email address will not be published. Required fields are marked *