gre*_*fox 2 javascript reactjs react-bootstrap
当我尝试使用React-Bootstrap设置FormControl的值时,我在控制台中遇到错误.
invariant.js:44 Uncaught Error: Objects are not valid as a React child (found: [object HTMLTextAreaElement]). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `FormGroup`.
Run Code Online (Sandbox Code Playgroud)
FormControl没有值的方法,因此不确定如何实现此目的.这就是我试图设置值的方式.
<FormGroup controlId="parameterDescription">
<ControlLabel>Description</ControlLabel>
<FormControl componentClass="textarea" placeholder="Description of parameter function" inputRef={(ref) => {this.state.description = ref}} readOnly={true}>
{this.state.description}
</FormControl>
</FormGroup>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4667 次 |
| 最近记录: |