StructureBuilder / react-keep-alive

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

更新state数据之后,通过props传递给下层组件,下层组件不会重新渲染。 #106

Open BiggerHacker opened 3 years ago

BiggerHacker commented 3 years ago

初始化定义state之后,ajax获取数据,通过props传递给下层表格组件,结果发现不会重新渲染,只会获取上层初始化传递的state。

daniellin01 commented 3 years ago

这个问题 可以用KeepAlive标签的extra属性传值,然后子组件加上@bindLifecycle 就能正确获取到值了。但didUpdat周期里 监控不到值得变化过程,直接就是变化后的结果