Skip to content

Error: useDayPicker must be used within a DayPickerProvider #4652

Answered by aleighton
dkumza asked this question in Q&A
Discussion options

You must be logged in to vote

I had this same issue a couple of days ago. In my case, I autocompleted an import of <Button /> in my code editor which referenced "react-day-picker" instead of "@/components/ui/button" when I was building a component. It gave me the same error you're having. Simple fix.

import { Button } from "@/components/ui/button"

not

import { Button } from "react-day-picker"

I hope that helps.

Edit. I think the issue is an <Button /> import somewhere else in your code, not this specific component.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@dkumza
Comment options

@HarrisonRogers
Comment options

@Sandaru-Shashinda
Comment options

@eskimm
Comment options

@ahammadabdullah
Comment options

Answer selected by dkumza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants