【发布时间】:2022-11-25 21:52:22
【问题描述】:
我有一个带有两个参数的函数,如下所示。如果它们在对象中,我可以按如下方式指定它们的类型
const renderItem = ({ item, index }: { item: string, index: number }) => {
return (
null
)
}
如果参数不在如下对象中,我如何指定它们的类型?
const renderItem = (item, index) => {
return (
null
)
}
【问题讨论】:
标签: reactjs typescript react-native