react 使用 useState useRef 添加TS使用方式
useState
type RecordItem = { title: string; total: number; id: number; color: string; } const [list, setList] = React.useState<RecordItem[]>(recordList);
useRef
const ref = useRef<HTMLElement | null>(null);
本文来自博客园,作者:玖捌,转载请注明原文链接:https://www.cnblogs.com/fyh0912/p/16491193.html
浙公网安备 33010602011771号