I am practicing frontend
skill please advice
The solution in my head is this. I have to debark the tab by myself
When I look into the official doc. I has a listener function implemented, but it will hand on the value when you click submit
button.
I want to dispatch
the selected value immediately in the app.
What is the best practice on this?
onSelect
is fine. I can see the selectedValue
, but it is not exact result I want. I want it from onChange
.
let ReactWidgetsForm = props => {
const {handleSubmit, pristine, reset, submitting, variants, colors} = props;
return (
<form onSubmit={handleSubmit}>
<div>
<Field
name="variantName"
component={DropdownList}
data={colors}
valueField="value"
textField="color"
onSelect={(event)=>{
console.log(event);
}}
onClick={(event) =>{
console.log(event.target);
}}
/>
</div>
</form>
)
};