I've been trying to write a custom declaration file for the 'react-dates' npm module, but can't get the compiler to resolve my declaration file to that module.
When I do import {DateRangePicker} from 'react-dates'
I get the following error:
Could not find a declaration file for module 'react-dates'. 'absolute_path/src/node_modules/react-dates/index.js' implicitly has an 'any' type.
My declaration file is located in the path '@types/react-dates/index.d.ts' and looks like this:
import * as React from 'react';
declare class DateRangePicker extends React.Component<{}, {}> { }
The tsconfig.json looks like this:
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"strictNullChecks": true,
"module": "commonjs",
"target": "es6",
"jsx": "react",
"typeRoots": [
"./@types"
]
},
"include": [
"./app/**/*",
"./@types/**/*"
]
}