【发布时间】:2022-01-15 19:37:20
【问题描述】:
我见过这个FC函数组件:
const LabelForm: FC<LabelFormProps> = ({
labels,
selectedID,
}) => {
const selectedLabel = selectedID !== undefined && labels[selectedID];
通常我是这样实现的:
interface EventProps {
lang: string;
translations: Translation;
eventId: string;
}
function Event(props: EventProps) {
const { lang, translations, eventId } = props;
它只是一种语法糖,还是比普通的有任何优势?
【问题讨论】:
标签: reactjs typescript next.js