BFE.dev
React 代码题14. implement useIsMounted()

14. implement useIsMounted()

ReactHooks
分享给更多人

  -通过 / -执行

When we handle async requests in React, we need to pay attention if the component is already unmounted.

Please implement useIsMounted() for us to easily tell if the component is still not unmounted.

上一个下一个

普通解法但是bugfree胜于奇技淫巧但是各种bug。

请求解答AI讨论(97)

Try it out

Console