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

Simple examples in typescript doesn't work #352

Open
ivose opened this issue Mar 1, 2023 · 4 comments
Open

Simple examples in typescript doesn't work #352

ivose opened this issue Mar 1, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ivose
Copy link

ivose commented Mar 1, 2023

Describe the bug
A clear and concise description of what the bug is.
import React from 'react'
import DatePicker, { DayValue, DayRange, Day } from 'react-modern-calendar-datepicker'

function App() {
const [day, setDay] = React.useState(null);
const [dayRange, setDayRange] = React.useState({
from: null,
to: null
});
const [days, setDays] = React.useState<Day[]>([]);

return (
<>



</>
);
}
export default App
image

Reproduced Version on CodeSandbox
Here it is on CodeSandBox: Link

Expected behavior
A clear and concise description of what you expected to happen.

@ivose ivose added the bug Something isn't working label Mar 1, 2023
@mohammadgarmroodi
Copy link

same bug here !

@synasapmob
Copy link

we cannot remove elements of "react-modern-calendar-datepicker",
follow in below the example can be useful for you,
finally why?? because the library was old 👎 also I don't see any 'dev/contribute' feedback....

<div display={isOpen ? "block" : "none"}> <Calendar /> </div>

@MohammadAzimi
Copy link

I would definitely suggest you use react-multi-date-picker instead
It supports all date formats and any thing you may want

@emrekrt1655
Copy link

emrekrt1655 commented May 12, 2023

We had same issue in a project. This helped us.

  • Remove react-modern-calendar-datepicker from your dependencies.

  • npm i @hassanmojab/react-modern-calendar-datepicker

  • import everything from @hassanmojab/react-modern-calendar-datepicker instead react-modern-calendar-datepicker

here for detail explanation https://stackoverflow.com/questions/73879703/react-typeerror-cannot-read-properties-of-null-reading-removeeventlistener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants