错误:错误:预期的",",在nextjs中'className'



错误:错误:nextjs 中应为",",得到"className">

我正试图使用bootstrap 4制作一个登录页面,但编译后显示了上述错误。

它在div标签的15行上显示错误

return (
<Head>
<title>Sign in</title>
</Head>
<form>
<div className="form-group">
<label for="exampleInputEmail1">Email address</label>
<small id="emailHelp" className="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div className="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" className="form-control" id="exampleInputPassword1" placeholder="Password" />
</div>
<div className="form-check">
<input type="checkbox" className="form-check-input" id="exampleCheck1" />
<label className="form-check-label" for="exampleCheck1">Check me out</label>
</div>

<button type="submit" className="btn btn-primary">Submit</button>
</form> 
)
}
export default signin

ReactJS不允许有2个父元素,请确保使用一个div作为父元素

return (
<div>
<Head>
...
</Head> 
<form> 
...
</form> 
</div>
)

相关内容

  • 没有找到相关文章

最新更新