Javascript JSX:预期的<;的相应结束标记;部门>;
我正在使用Babel6.0编译JSX代码,我遇到了这个错误。在它说“相邻元素”需要被包装在“封闭标签”中之后,它现在说标签缺少“相应的封闭标签”,尽管Javascript JSX:预期的<;的相应结束标记;部门>;,javascript,reactjs,babeljs,jsx,Javascript,Reactjs,Babeljs,Jsx,我正在使用Babel6.0编译JSX代码,我遇到了这个错误。在它说“相邻元素”需要被包装在“封闭标签”中之后,它现在说标签缺少“相应的封闭标签”,尽管标签是封闭的。为什么会这样?多谢各位 下面是代码:它显示行作为错误位置 render: function() { return ( <div> <form action={this.props.action} method={this.props.method}/>
标签是封闭的。为什么会这样?多谢各位
下面是代码:它显示
行作为错误位置
render: function() {
return (
<div>
<form action={this.props.action} method={this.props.method}/>
<input
type={this.props.input1type}
value={this.state.input1value}
/>
<input
type={this.props.input2type}
value={this.state.input2value}
/>
</form>
</div>
);
}
render:function(){
返回(
);
}
那里有一个打字错误。一种自封闭的形式。只需从结束选择表单标记中删除/即可
render: function() {
return (
<div>
<form action={this.props.action} method={this.props.method}>
<input
type={this.props.input1type}
value={this.state.input1value}
/>
<input
type={this.props.input2type}
value={this.state.input2value}
/>
</form>
</div>
);
}
render:function(){
返回(
);
}
那里有一个打字错误。一种自封闭的形式。只需从结束选择表单标记中删除/即可
render: function() {
return (
<div>
<form action={this.props.action} method={this.props.method}>
<input
type={this.props.input1type}
value={this.state.input1value}
/>
<input
type={this.props.input2type}
value={this.state.input2value}
/>
</form>
</div>
);
}
render:function(){
返回(
);
}
注意
末尾的/>。您正在关闭表单,因此当编译器到达
时,没有要关闭的标记Hanks,它现在可以工作了。请注意
末尾的/>。您正在关闭表单,因此当编译器到达
时,没有要关闭的标记Hanks,它现在可以工作了。