yezihaohao/react-admin

Tuple type '[any, ISetAlita]' of length '2' has no element at index '2'. TS2493 问题

morgeq opened this issue · 2 comments

QQ截图20200921211111
Failed to compile
D:/www/react-admin/src/App.tsx
TypeScript error in D:/www/react-admin/src/App.tsx(96,30):
Tuple type '[any, ISetAlita]' of length '2' has no element at index '2'. TS2493

94 | const App = (props: AppProps) => {
95 |     const [collapsed, setCollapsed] = useState<boolean>(false);

96 | const [auth, responsive, setAlita] = useAlita(
| ^
97 | { auth: { permissions: null } },
98 | { responsive: { isMobile: false } },
99 | { light: true }
This error occurred during the build time and cannot be dismissed.
!

const [auth, setAlita] = useAlita(
{ auth: { permissions: null } },
{ light: true, }
);
const [responsive] = useAlita(
{ responsive: { isMobile: false } },
);

搞定

已修复,拉取最新代码