什么是react-bootstrap中的controlId

San*_*aha 6 javascript reactjs react-bootstrap

我刚刚通过React-bootstrap表单,它的用途controlId是什么,它类似于name我们在遗留形式中使用的?

<form>
    <FormGroup
      controlId="formBasicText" ---------------------->> what is the use?
      validationState={this.getValidationState()}
    >
      <ControlLabel>Working example with validation</ControlLabel>
      <FormControl
        type="text"
        value={this.state.value}
        placeholder="Enter text"
        onChange={this.handleChange}
      />
      <FormControl.Feedback />
      <HelpBlock>Validation is based on string length.</HelpBlock>
    </FormGroup>
  </form>
Run Code Online (Sandbox Code Playgroud)

Sag*_*b.g 9

正如DOCS所说:

设置ID打开<FormControl>htmlFor打开<FormGroup.Label>.

基本上它是输入id和标签的for属性.

在此输入图像描述