【发布时间】:2020-04-28 19:18:07
【问题描述】:
我什么时候可以在我的 React 代码中使用以下方法?
componentWillUnmount()
请举个例子。
【问题讨论】:
-
嗨!请使用tour(您将获得徽章!),环顾四周,并阅读help center,尤其是How do I ask a good question?,我还推荐Jon Skeet 的Writing the Perfect Question。恐怕不清楚你在问什么。 你不调用那个方法。 React 在要卸载组件时执行此操作。详情见the documentation。
标签: javascript reactjs dom