shenjunru / react-fiber-keep-alive

A component that maintains component state and avoids repeated re-rendering.
MIT License
60 stars 1 forks source link

重缓存取出放回的时候,会重新执行useEffect 如果此页面有接口等操作会导致页面接口刷新。 #12

Closed 1021683053 closed 1 year ago

1021683053 commented 1 year ago

A页面离开缓存起来,当页面放回时候,就会出现再次执行副作用。期望,副作用能再 KeepAlive props 加一个参数来判断是否需要再次执行,如果不需要再次执行,那么卸载组件的时候也不清除副作用