【发布时间】:2020-09-22 00:53:08
【问题描述】:
我的 IDE 在这个 typescript (tsx) sn-p 中显示 2 个错误:
// @ next line: TS2300: Duplicate identifier 'boolean'.
const SlidesControl = ({ previous: boolean, next: boolean }) => {
return (
// @ next line: TS2304: Cannot find names 'previous' and 'next'.
<nav>TODO {previous} {next}</nav>
)
}
为什么?
【问题讨论】:
标签: typescript ecmascript-6 react-tsx