Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Reactjs `openAlertAbsent` is not a function

After opening the popup, when i click the icon close i’ve receive an error saying openAlertAbsent is not a function`

const [openAlertAbsent, setOpenAlertAbsent] = useState({
        open: false,
        success: false,
      });

 .....
setOpenAlertAbsent({
  open: true,
  success: true,
})
 .....

  const handleAbsent = () =>{
    if (openAlertAbsent.success) {
      openAlertAbsent({
        open: false,
        success: false,
      });
    }
  }


  ....

   <AlertIgnoreStudent
        open={openAlertAbsent.open}
        handleClose={handleAbsent}
        success={openAlertAbsent.success}
   />

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

const [openAlertAbsent, setOpenAlertAbsent] = useState({
        open: false,
        success: false,
      });

 .....
setOpenAlertAbsent({
  open: true,
  success: true,
})
 .....

  const handleAbsent = () =>{
    if (openAlertAbsent.success) {
      openAlertAbsent({  // here is a problem, maybe setOpenAlertAbsent?
        open: false,
        success: false,
      });
    }
  }


  ....

   <AlertIgnoreStudent
        open={openAlertAbsent.open}
        handleClose={handleAbsent}
        success={openAlertAbsent.success}
   />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading