在我从 ReactSelect 中选择或更改选项后的电子邮件字段(实际上,所有其他字段都将被清除)
怎么来的?
表单.jsx
<Field
name="email"
component="input"
type="email"
placeholder="Email"
/>
<Field
name="selectedTable"
value={selectedTable}
tableList={this.props.tableList}
selectTableChange={this.props.selectTable}
component={TableNameSelect}
/>
反应选择.jsx
import * as React from 'react'
import {connect} from 'react-redux'
import {Field} from 'redux-form'
import * as ReactSelect from 'react-select';
<ReactSelect
{...input}
value={input.value}
options={tableListOptions}
placeholder="Select Table..."
onChange={(option:any)=>{
selectTableChange(option.value)
input.onChange(option)
}}
onBlur={
(e:any) => {
input.onBlur(input.value)
console.log(this.props)
}
}
/>