export default useMount; useUnmount useUnmount,組件卸載(unmount)時(shí)執(zhí)行的 Hook。 useEffect 可以在組件渲染后實(shí)現(xiàn)各種不同的副作用。有些副作用可能需要清除,所以需要返回一個(gè)函數(shù),這個(gè)函數(shù)會(huì)在組件卸載的時(shí)候執(zhí)行。 1 2 3 4 5 6 7 8 9 10 11 12 const useUnmount = (fn: () => void) => { const...
www.dbjr.com.cn/article/2549...htm 2025-5-27