diff --git a/src/components/checkmark/checkmark.js b/src/components/checkmark/checkmark.js index 378f436..0e29bda 100644 --- a/src/components/checkmark/checkmark.js +++ b/src/components/checkmark/checkmark.js @@ -29,6 +29,10 @@ const variants = { function Checkmark({ id, initialValue, habitId, date, disabled }) { const [value, setValue] = React.useState(initialValue); + React.useEffect(() => { + setValue(initialValue); + }, [initialValue]); + const updateCheckmarkInDb = useUpdateCheckmarkInDb(); // Debounced update function