2017-03-01 9 views
1

React-Bootstrapを使用してFormControlの値を設定しようとしているので、コンソールでエラーが発生しています。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`. 

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> 

答えて

5

これは権利である:

<FormControl value={someText}/> 
関連する問題