2.渲染
`<Freetest/>`
### Error Trace (if possible)
index.js:1375 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in Popover (at free_test.js:17)
### Solution
照着上面的代码,创建一个以click触发的消失又出现的popover元素,然后尝试用鼠标去打开Popover,然后控制台就会报警
Description
动态渲染且触发条件为click的Popover,消失后再出现,再尝试触发时,控制台报警Warning: Can't perform a React state update on an unmounted component
Reproduce Steps
class Freetest extends React.Component{ constructor(props){ super(props) this.state = {sh : true} setTimeout(()=>{this.setState({sh:false})}, 2000) setTimeout(()=>{this.setState({sh:true})}, 4000) } render(){ return (
} }
export {Freetest}