react is mounted hook:React钩子以检查组件是否仍然安装 源码
React是挂机 React钩子,以检查组件是否仍然安装 安装 // with npm npm install react-is-mounted-hook // with yarn yarn add react-is-mounted-hook 如何使用 import React , { useState , useEffect } from 'react' ; import useIsMounted from 'react-is-mounted-hook' ; import axios from 'axios' ; import Loading from './loading' ; import Result from './result' ; const FetchComponent = ( ) => { const isMounted = useIsMounted ( ) ;
用户评论