【发布时间】:2018-08-06 01:43:23
【问题描述】:
注意到为输入设置了 defaultValue 的一些奇怪之处,但有时刷新页面时它不可见。我已经尝试过 console.log,然后组件在加载数据时重新渲染多次,在最后一次重新渲染时,组件包含所需的值,如您在屏幕截图中所见,但未显示。知道为什么吗?谢谢
<input type="text" name={this.props.question.id}
defaultValue={defaultValue}
onChange={this.onSingleChange.bind({
selectAnswer: this.props.selectAnswer,
question: this.props.question,
form: this.props.fid
})}
className="form-control"
/>
【问题讨论】:
标签: reactjs input react-redux