typescript 为函数参数定义一个类型

67 阅读1分钟
type SearchProps = { children: string}
function SearchProvider({ children }: SearchProps ) {
  console.log('children:', children)
}

SearchProvider({children: 'thtsssss'})