这是我的 React 渲染块。我在这里使用 HTML5 验证,使用 required。这东西应该可以正常工作。但它不起作用。谁能建议我如何在 React 中使用 HTML5 验证?
<div >
<div className="modal-dialog">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" className="form-control" name="email" required
placeholder="Enter a valid email address" id='email' ref="email"/>
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Password</label>
<div class="col-sm-10">
<input type="password" className="form-control" id='password' ref="password" required
placeholder="Password must be 10 character long"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" input type="submit" className="btn btn-success"
onClick={this.saveNewUser}>Register
</button>
</div>
</div>
<div>
</div>
</div>
</div>