在我的
我应该将其作为组件内部的函数吗?
意外的令牌(190:32)
reactjs
组件中,在渲染时,我想创建一个开关语句,根据开关条件使用特定的组件。但这里有一个语法错误。我应该将其作为组件内部的函数吗?
意外的令牌(190:32)
188 |
189 | {
> 190 | return (
| ^
以下是组件的完整返回函数:
return (
<div className="Page">
....
{
elements.map(function(element, index){
return (
<Col xs={24} sm={element["grid-width"]*2} md={element["grid-width"]} key={index} className="element-container">
.....
<div className="contents">
{
return (
switch (element.type) {
case 'we-are-always-here-to-help':
sss
break;
case 'call-us-when-you-are-having-difficulties':
xx
break;
default:
}
)
}
</div>
</Col>
)
})
}
</div>
)