interface AppStateValue {
username:string,
shoppingCart:{items:{id:number,name:string}[]}
}
const defaultContextValue:AppStateValue= {
username:"alai",
shoppingCart:{items:[]}
}
items:[] =》TS items:{id:number,name:string}[]
React18 精讲 + 结合 TS 实战 + 热门业务开发,获取必备技能
了解课程