Skip to content

How does useDayPicker or useActiveModifiers work? #1815

Answered by gpbl
wannesdebacker asked this question in Support
Discussion options

You must be logged in to vote

@wannesdebacker if I understand correctly, you want to know the modifiers of the date entered in the input field (e.g. is the typed date already selected?). Am I correct? Since you decide the logic of this modifiers, you should be able to tell by yourself in the code – without he need of the DayPicker hooks:

https://codesandbox.io/s/react-daypicker-forked-hdwwrw?file=/src/App.tsx

DayPicker hooks are for custom components. If you want for some reason use these hooks, you need to place your input field in a custom component, such a Caption or a Footer. There the hooks are accessible (you can import the original component as well):

https://codesandbox.io/s/react-daypicker-forked-gdjnxx?file=…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by gpbl
Comment options

You must be logged in to vote
0 replies
Comment options

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

@gpbl
Comment options

@wannesdebacker
Comment options

@wannesdebacker
Comment options

@gpbl
Comment options

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