我正在创建一个自定义输入组件,需要在表单中更改其他输入值时进行更改。
<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.foo
在ReferenceInput
更改时不会更新。)