parent component Form form
submit= (e) => {
this.props.form.validateFields((err, values) => {
if (!err) {
consle.log(values)
}
});
}
<Form onSubmit={this.submit}>
<FormItem label={""}>
{getFieldDecorator("aaaa", {rules: [{}],})(
<Currency valueChange={this.valueChange}/>
)}
</FormItem>
</Form>
customize Currency components
import React from "react"
import {Select} from "antd";
const Option = Select.Option
class Currency extends React.Component {
render() {
return (
<Select>
<Option value="CNY">RMB</Option>
<Option value="BTC">BTC</Option>
<Option value="USDT">USDT</Option>
</Select>
);
}
}
export default Currency;
is there any other good way to pass the value of the custom component back to the parent component