【发布时间】:2021-05-06 10:30:43
【问题描述】:
我想直接将 props 用作变量,而不在它们前面添加 props 对象。
喜欢:onChange={handleChange},而不是onChange={props.handleChange}
type Props = {
handleChange: Function,
values: Object,
t: Function
}
function RadioList(props: Props) {
return (
<div className={css.radioList}>
<RadioField
isFormik
name="some_name"
label={t('some_label')}
onChange={handleChange}
className={css.listFilterRadio}
/>
</div>);
}
【问题讨论】:
标签: javascript reactjs types flowtype