我正在使用
react-final-form
https://final-form.org/docs/react-final-form/examples
当我点击一个按钮时,我想显示如下图片
required
https://codesandbox.io/s/cool-torvalds-lhe9d
export const renderRadio = field => (
<SForm.Radio
checked={field.input.value === field.radioValue}
label={field.label}
required={field.required}
error={field.error && field.touched}
//error={true}
name={field.input.name}
onChange={(e, { checked }) => field.input.onChange(field.radioValue)}
/>
);
//error={true}
hardcorded
它显示了预期的输出。
但我想要同样的行为在按钮点击