admin管理员组文章数量:1279021
As I am trying to set the value of a FormControl using React-Bootstrap I am encountering an error in the console.
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`.
The FormControl doesn't have a method for value so not sure how else to acplish this. This is how I am trying to set the value.
<FormGroup controlId="parameterDescription">
<ControlLabel>Description</ControlLabel>
<FormControl ponentClass="textarea" placeholder="Description of parameter function" inputRef={(ref) => {this.state.description = ref}} readOnly={true}>
{this.state.description}
</FormControl>
</FormGroup>
As I am trying to set the value of a FormControl using React-Bootstrap I am encountering an error in the console.
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`.
The FormControl doesn't have a method for value so not sure how else to acplish this. This is how I am trying to set the value.
<FormGroup controlId="parameterDescription">
<ControlLabel>Description</ControlLabel>
<FormControl ponentClass="textarea" placeholder="Description of parameter function" inputRef={(ref) => {this.state.description = ref}} readOnly={true}>
{this.state.description}
</FormControl>
</FormGroup>
Share
Improve this question
asked Mar 1, 2017 at 13:28
greyfoxgreyfox
6,61624 gold badges74 silver badges116 bronze badges
1 Answer
Reset to default 10This is right:
<FormControl value={someText}/>
本文标签: javascriptreactbootstrap set value of FormControlStack Overflow
版权声明:本文标题:javascript - react-bootstrap set value of FormControl - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741222387a2361210.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论