【发布时间】:2019-04-15 13:17:48
【问题描述】:
我有类似以下的内容:
functionName = () => {
const {
prop1,
prop2,
prop3,
} = this.props;
const collectionOfProps = {
'ONE': prop1,
'TWO': prop2,
'THREE': prop3,
}
return (
<FirstWrapper>
collectionOfProps={collectionOfProps}
</FirstWrapper>
)
}
在我的FirstWrapper 我有这样的功能
const firstConst = ( {collectionOfProps} ) => firstFunction(
collectionOfProps[ONE],
hardCodedValue
)
const firstFunction = (value1, value2) => {
value1 === something
? true
: false
}
但我目前收到以下控制台错误
ONE is not defined
在这方面的任何帮助都会很棒!
【问题讨论】:
标签: reactjs ecmascript-6 styled-components react-props