Closed redefinitionof closed 3 years ago
Hi,
it is a regular React component. Your issues are not reactstrap-date-picker related.
import DatePicker from 'reactstrap-date-picker';
The following now both work, but both give the intellisense? warning as described in original question (grey underline text that on hover show a pop-up). Code seems to work though. import DatePicker from 'reactstrap-date-picker'; import * as DatePicker from 'reactstrap-date-picker';
The problem is not reported anywhere else. It seems to also be reported for other items. (for example: import { Multiselect } from 'multiselect-react-dropdown';) I ignore it.
In your documentation you use:
var DatePicker = require("reactstrap-date-picker");
I like to use import in React. When I use
import {DatePicker } from 'reactstrap-date-picker';
It can't find DatePicker.It works when I use:
import * as DatePicker from "reactstrap-date-picker";
But then I see a warning in Visual Studio Code: Could not find a declaration file for module 'reactstrap-date-picker'. 'c:/Users/\<username>/node/\<myApp>/node_modules/reactstrap-date-picker/lib/index.js' implicitly has an 'any' type. Try
npm i --save-dev @types/reactstrap-date-picker
if it exists or add a new declaration (.d.ts) file containingdeclare module 'reactstrap-date-picker';
ts(7016)Why doesn't this work like a regular react component? How to make it work without errors/warnings?