如何将react-bootstrap
<Input>
与ref
一起使用。
import { Input } from 'react-bootstrap'
<input ref={node => {
input = node
}} placeholder="Enter text"/>
当我将上面的代码更改为下面显示的代码时,输入字段消失而没有任何错误。如何使用react-bootstrap
<Input> field
以及ref
<Input type="text" ref={node => {
input = node
}} placeholder="Enter text"/>
答案 0 :(得分:0)
存在称为输入包装器的东西,它没有任何type
。可以轻松完成。为此打扰StackOverflow道歉。
<Input wrapperClassName="wrapper">
<input className="form-control" ref={node => {
input = node
}} placeholder="Enter text"/>
</Input>