Comments (5)
@otatar For the time being, you can just create a tailwind-datepicker-react.d.ts
file with the following content:
declare module 'tailwind-datepicker-react' {
import { ReactElement } from 'react';
interface ITheme {
background: string;
todayBtn: string;
clearBtn: string;
icons: string;
text: string;
disabledText: string;
input: string;
inputIcon: string;
selected: string;
}
interface IIcons {
prev: () => ReactElement;
next: () => ReactElement;
}
export interface IOptions {
title?: string;
autoHide?: boolean;
todayBtn?: boolean;
todayBtnText?: string;
clearBtn?: boolean;
clearBtnText?: string;
maxDate?: Date;
minDate?: Date;
theme?: ITheme;
icons?: IIcons;
datepickerClassNames?: string;
defaultDate?: Date | null;
language?: string;
weekDays?: string[];
disabledDates?: Date[];
inputNameProp?: string;
inputIdProp?: string;
inputPlaceholderProp?: string;
inputDateFormatProp?: Intl.DateTimeFormatOptions;
}
type DatepickerProps = {
children?: ReactElement | ReactNode;
options?: IOptions;
onChange?: (date: Date) => void;
show: boolean;
setShow: (show: boolean) => void;
classNames?: string;
selectedDateState?: [Date, (date: Date) => void];
}
export default function Datepicker(props: DatepickerProps): ReactElement
}
from tailwind-datepicker-react.
So... I pulled the repo to take a look at it myself, and the reason why there's no declaration file generated is that the
build:dts
script fails with the following:Now, I've checked the TypeScript repo and as per this issue, it looks like this type is only available in
es2020
. I've played around with changing the target toes2020
, but that's causing even more issues:The only easy way of fixing this I've found is just ts-ignoreing that line, which does emit declaration files. @OMikkel What do you reckon we should do in this case?
I will be pushing a new version where the ts error is ignored.
It is not really a huge deal ignoring that error since it obviously exists on the class Intl
from tailwind-datepicker-react.
I was just about to post the same issue 👍
from tailwind-datepicker-react.
So... I pulled the repo to take a look at it myself, and the reason why there's no declaration file generated is that the build:dts
script fails with the following:
Now, I've checked the TypeScript repo and as per this issue, it looks like this type is only available in es2020
. I've played around with changing the target to es2020
, but that's causing even more issues:
The only easy way of fixing this I've found is just ts-ignoreing that line, which does emit declaration files. @OMikkel What do you reckon we should do in this case?
from tailwind-datepicker-react.
The same issue here :/
from tailwind-datepicker-react.
Related Issues (20)
- Is it possible to style the selected day?
- Is it possible to not select a date when moving to prev or next month.
- Advanced Not Holding State
- When using <input> as children this condition does not allow the calendar to autoHide HOT 4
- How to change input icon? HOT 1
- How to make specific dates disabled? HOT 3
- issue to listen on clear button click HOT 2
- Works but width of the months container is off.
- Change theme props. Separate `disabledText` with `otherMonthText` style
- Support to render components inside popup
- Type definition not updated
- onFocus triggers on form rendering
- handleClickOutside doesn't work when providing own `input` element HOT 3
- Update npm package with the latest changes
- How can we set a controlled value? HOT 2
- Is there any way to disable previous dates? HOT 1
- Is there any way to show only Months View?
- Classnames on the Input Field
- minDate and maxDate dont prevent navigating across disabled dates. HOT 2
- Placeholder prop not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwind-datepicker-react.