Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker types error using Luxon DateTime #48757

Closed
jonmurciano opened this issue May 3, 2024 · 7 comments
Closed

DatePicker types error using Luxon DateTime #48757

jonmurciano opened this issue May 3, 2024 · 7 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed

Comments

@jonmurciano
Copy link

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Insert DateTime with onChange property.

What is expected?

onChange property on DatePicker component returns typinng error not admitting nullable DateTime.

What is actually happening?

onChange property on DatePicker component returns typinng error not admitting nullable DateTime

Environment Info
antd 5.14.0
React react
System Windows 10 Pro 22H2
Browser Google Chrome 124.0.6367.119 (Build oficial) (64 bits)
@afc163
Copy link
Member

afc163 commented May 4, 2024

图片

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label May 4, 2024
Copy link
Contributor

github-actions bot commented May 4, 2024

Hello @jonmurciano. Please provide a online reproduction by forking codesandbox of [email protected] or [email protected], or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @jonmurciano,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 [email protected][email protected] 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

@jonmurciano
Copy link
Author

Hello, I've already solved the access to codesandbox.

@afc163
Copy link
Member

afc163 commented May 6, 2024

How could I reproduce the type error?

图片

@pabloimrik17
Copy link

Hi, we are having some problems trying to import LuxonGenerateConfig from rc-picker in the sandbox.

This is our situtation after 5.14.

We are creating a Datepicker based on Luxon following your guide

https://ant.design/docs/react/use-custom-date-library/

image
image

Based on that we create our picker wrapper component, empty as showed below, nothing custom yet
image

Now the onChange event in your types is missing | null.

image

onChange type from 5.14

image

before to 5.14

image

@afc163
Copy link
Member

afc163 commented May 6, 2024

Could you reproduce it in your codesandbox?

@pabloimrik17
Copy link

Sorry guys, after reviewing the error was a little mistake on our side. Closing the issue

Thank for your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed
Projects
None yet
Development

No branches or pull requests

3 participants