EffectuseUnmount本页总览useUnmount 组件卸载的时候执行 Usage 实时编辑器 function Demo() { const [value] = useState("mounted"); useUnmount(() => { alert("UnMounted"); }); return <div>{value}</div>; }; 结果Loading... API