react-nice-dates icon indicating copy to clipboard operation
react-nice-dates copied to clipboard

Support react 17

Open AXeL-dev opened this issue 4 years ago • 7 comments

Added support for react 17 as peer dependency.

AXeL-dev avatar Jun 28 '21 19:06 AXeL-dev

Hey just wondering what this PR is waiting for? Thanks

ZilRahman avatar Dec 08 '21 22:12 ZilRahman

Hey just wondering what this PR is waiting for? Thanks

It looks like this repo is not active currently. As a workaround you can install this patched version.

AXeL-dev avatar Dec 08 '21 22:12 AXeL-dev

Hey @AXeL-dev, i tried installing the patched version and it gives me this error :@axel-dev/react-nice-dates.d.ts is not a module Screen Shot 2021-12-08 at 4 33 03 PM .

ZilRahman avatar Dec 08 '21 23:12 ZilRahman

Hey @AXeL-dev, i tried installing the patched version and it gives me this error :@axel-dev/react-nice-dates.d.ts is not a module Screen Shot 2021-12-08 at 4 33 03 PM .

Did you keep both modules? 'cause i see in the bottom an import line with react-nice-dates/build/style.css. You should uninstall the react-nice-dates module & replace the css import with import '@axel-dev/react-nice-dates/build/style.css'. if it still doesn't work, try to reinstall the module (patched version) from npm.

AXeL-dev avatar Dec 10 '21 14:12 AXeL-dev

I have the same problem than @ZilRahman :(

I have this issue /node_modules/@axel-dev/react-nice-dates/index.d.ts' is not a module when I import like this import { DateRangePickerCalendar, DateRangePickerCalendarProps, DateChangeCallBack, } from '@axel-dev/react-nice-dates';

I uninstall react-nice-dates

danieltoro avatar Feb 23 '22 17:02 danieltoro

I have the same problem than @ZilRahman :(

I have this issue /node_modules/@axel-dev/react-nice-dates/index.d.ts' is not a module when I import like this import { DateRangePickerCalendar, DateRangePickerCalendarProps, DateChangeCallBack, } from '@axel-dev/react-nice-dates';

I uninstall react-nice-dates

You're getting this error because the library is written in javascript & you're using it on a typescript project, the best solution would be to install a types declarations module (something like @types/@axel-dev/react-nice-dates), but i don't really have enough time to create that module & publish it, so for now here is a quick solution:

  1. Create a file in the root of your project & name it declarations.d.ts.
  2. Open that file & paste the following line into it (don't forget to save):
declare module '@axel-dev/react-nice-dates';
  1. Go to your tsconfig.json file & add the file that we just created to the include entry:
{
   ...,
   "include": [
     ...,
+    "declarations.d.ts"
   ]
}

Your error should be fixed after that.

AXeL-dev avatar Feb 23 '22 19:02 AXeL-dev

@danieltoro, the types declarations issue was fixed in version 3.1.2. Simply update the library using:

npm i @axel-dev/react-nice-dates@latest

AXeL-dev avatar Mar 02 '22 13:03 AXeL-dev