剩余参数
使用 & 来声明 props 的类型
1 | const ListItem = ({ |
children
1 | children?: React.ReactNode | undefined; |
字典的 key
1 | const foo: {[key: string]: string} = { |
useRef
1 | const allPageData = useRef<UIRecord[]>([]); |
1 | const listRef = useRef<FlatList|null>(); |
type
普通 type
1 | export type FooType = { |
type 联合
1 | export type FooType = { |
type 联合 2
1 | interface OriginProps = { |
类型强转
1 | const date: DateData = data.date as DateData; |