hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

React v18 Support #604

Open joshmedeski opened 1 year ago

joshmedeski commented 1 year ago

Can this package be updated to be compatible with React v18?

I get the following error when trying to use this package in a NextJS v13 app (which uses react@^18.2.0):

'DateRangePicker' cannot be used as a JSX component. Its instance type 'DateRangePicker' is not a valid JSX element. The types returned by 'render()' a typescript (2786) [184, 16]

I'm familiar with overwriting @types/react or setting resolutions in the package but it would be best if this package could be upgraded and tested with React v18, thanks.

umakantp commented 6 months ago

I have created a new package to make it work with React 18 and latest date-fns

https://www.npmjs.com/package/@umakantp/react-date-range