列出和迭代 props 变量中的变量键和值的最简单方法是什么?
我无法使用 PureComponent
,我应该检查 componentWillReceiveProps(nextProps)
和 shouldComponentUpdate(nextProps, nextState)
函数中的变量。
谢谢!
最佳答案
您可以对其进行映射,例如
for (let key in nextProps) {
const value = nextProps[key]
}
关于javascript - 如何列出 props 变量中的项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54462226/