How do I import react-admin in a React Typescript appplication?
Current version of react-admin does not export types definition. To make your project to compile you need to create index.d.ts
file and modify tsconfig.json
.
├── @types
│ └── react-admin
│ └── index.d.ts
└── tsconfig.json
// tsconfig.json
{
...
"compilerOptions": {
...
"typeRoots": ["./@types"],
...
},
...
}
// index.d.ts
declare module 'react-admin';