#'DateRangePickerValue' component not found

19 messages · Page 1 of 1 (latest)

glad stump
#

I'm trying to implement a ranged date picker (in v. 5.9.5) according to the documentation example at https://mantine.dev/dates/date-picker/ and I'm getting an error indicating that 'DateRangePickerValue' can't be found. I see an export for it in DateRangePicker.tsx but React can't seem to find it. Am I going about this the wrong way? I've attached screenshots of the error and my code (which I basically just pasted from the Docs). Thanks in advance for any help!

Capture date or dates range from user

wet basalt
#

I see an export for it in DateRangePicker.tsx but React can't seem to find it
types are not global (usually), so react will not find it unless it's imported

glad stump
wet basalt
#

in that screenshot it is greyed out, how does your useState code look like currently

#

here is a codesandbox with 5.9.5 and DateRangePickerValue

#

double check your syntax in useState

#

if that doesn't solve it, try to restart your TS compiler

glad stump
#

You know

wet basalt
#

can also try running npm or yarn again in case the package wasn't properly installed

glad stump
#

Maybe the issue is that I'm using JS. I guess Mantine is typescipt based?

#

Sorry if this is a dumb question, this is my first time using Mantine

wet basalt
#

yeah, that's typescript syntax

#

it's worth moving over to typescript at some point, once you get past the learning curve it removes a lot of JS headaches

glad stump
#

It's been on the to-do list

wet basalt
#

especially during migration, when you need to upgrade big projects it'll tell you where all the errors are, in JS you can only find out by running the app

glad stump
#

Okay, I rewrote it in the proper js syntax and it works now

#

I wasn't sure what was going on there but didn't want to tamper with it at first haha