I am creating a todo app in which i am taking two input one is the todostring and other is a due date of the todo that is of type datetime-local.I want to show a toast notification whenever the due date of the todo is expired.enter image description here
you can just use setTimeout() on the first render of the todo component.
useEffect(() => {
const timeout = setTimeout(() => showToast(), expirationDate-currentDate);
return () => {
clearTimeout(timeout)
};
}, []);