Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
这个错误是因为,因为我们直接修改父组件传递过来的参数,这样会存在影响外部 组件的风险。
解决方案:
在组件内部再构建一套属性域,来存储父组件传递过来的参数,从而与外界解耦
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
这个错误是因为,因为我们直接修改父组件传递过来的参数,这样会存在影响外部 组件的风险。
解决方案:
在组件内部再构建一套属性域,来存储父组件传递过来的参数,从而与外界解耦
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。