🧩 Plasmo Developers�PD
🧩 Plasmo Developers3y ago
42 replies
sumit

help w/ mantine notifications

i've got mantine modals working in content.tsx but notifications don't seem to work, probably not mounting them correctly. can anyone provide some help (or code) on how to use mantine notifications in content.tsx [https://mantine.dev/others/notifications/]

here's the modal:
import { useState } from 'react';
import { Modal } from '@mantine/core';

export default function MyComponent() {
  const [open, setOpen] = useState(false);

  const handleButtonClick = () => {
    setOpen(true);
  }

  const handleClose = () => {
    setOpen(false);
  }

  return (
    <>
      <button onClick={handleButtonClick}>Open Modal</button>
      <Modal
        title="My Modal"
        opened={open}
        onClose={handleClose}
      >
        This is the content of my modal.
      </Modal>
    </>
  );
}
Was this page helpful?