如何应对SimpleForm输入中的更改?

时间:2017-07-09 03:33:10

标签: redux-form admin-on-rest

我正在创建一个自定义输入组件,需要在表单中更改其他输入值时进行更改。

<ReferenceInput source="foo">
  <SelectInput />
</ReferenceInput>
<NumberInput onChange={(e, newValue) => {this.setState({ newValue })} />
<CustomInput numberValue={this.state.newValue} />

NumberInput发生变化时,我可以传递CustomInput新值。但是ReferenceInput / SelectInput没有onChange。如何将SelectInput的新值添加到CustomInput? (请注意,在CustomInput内,props.record.fooReferenceInput更改时不会更新。)

1 个答案:

答案 0 :(得分:2)