在React JSX中,似乎不可能执行以下操作:
render: function() {
return (
<{this.props.component.slug} className='text'>
{this.props.component.value}
</{this.props.component.slug}>
);
}
我得到一个解析错误:意外的标记{.这不是什么react 吗
我正在设计这个组件,以便在后台,存储在this.props.component.slug
中的值将包含有效的HTML元素(h1、p等).有什么办法可以让这一切顺利进行吗?