Trigger event depending on local state on component unmount in React – Javascript
I have a component with some internal state that is not being propagated throughout the application just on certain events. const FunComponent = (initialDescription, onSave) => { const [description, setDescription] = useState('initialDescription'); const handleDescriptionSave = () => { onSave(description); }…