每次调用该方法都会提示
index.js:1 Warning: Cannot update a component (Index
) while rendering a different component (Addpro
). To locate the bad setState() call inside Addpro
请问各路大神 这个问题如何解决
父组件
子组件
每次调用该方法都会提示
index.js:1 Warning: Cannot update a component (Index
) while rendering a different component (Addpro
). To locate the bad setState() call inside Addpro
请问各路大神 这个问题如何解决
父组件
子组件
13 回答12.9k 阅读
8 回答2.7k 阅读
2 回答5.1k 阅读✓ 已解决
5 回答1.3k 阅读
3 回答2.2k 阅读✓ 已解决
5 回答1.5k 阅读✓ 已解决
3 回答2.2k 阅读
把props.changeVisible这句移到该去的钩子里,直接在函数组件顶层调这种会改变状态的功能显然不太合适