Reactjs – Can i call componentWillUnmount (functional component) with current data?
I have a functional component export const Example = () => { const [data, setData] = useState<number>(0); useEffect(() => { return () => { console.log("data", data); // ----> Here i want current value of data at the componentWillUnmount }; },…