{children} )
export default Button; 它完全按照我所希望的那样工作,但是在运行tsc时得到以下错误 Element implicitly has an 'any' type because expression of type 'string' can't be usedNo index signature with a param
我认为问题已经足够清楚了,下面的代码让我感到疑惑: type T = { (value: string): string if (typeof value === "number") return []}
bar(10) // []对我来说,编译器在下面的例子中抛出一个错误是不一致的: 第二个例子 const