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

Support react 17 #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

AXeL-dev
Copy link

Added support for react 17 as peer dependency.

@ZilRahman
Copy link

Hey just wondering what this PR is waiting for? Thanks

@AXeL-dev
Copy link
Author

AXeL-dev commented Dec 8, 2021

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.

@ZilRahman
Copy link

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
.

@AXeL-dev
Copy link
Author

AXeL-dev commented Dec 10, 2021

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.

@danieltoro
Copy link

danieltoro commented Feb 23, 2022

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

@AXeL-dev
Copy link
Author

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
Copy link
Author

AXeL-dev commented Mar 2, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants