'DayPicker days not clickable REACT
I tried to use this react-day-picker component to pick a single day on my site but it is not clickable.
I took the code from https://react-day-picker.js.org/ and there they show the day is clickable I did not understand what I did wrong (i tried all their codes none is clickable )
this is the code I am using-
import React, { useState } from 'react';
import { DayPicker } from 'react-day-picker';
import { format } from 'date-fns';
export default function App() {
const [selectedDay, setSelectedDay] = useState<Date>("");
const footer = selectedDay
? `You selected ${format(selectedDay, 'PPP')}.`
: `Please pick a day.`;
return (
<DayPicker
mode="single"
selected={selectedDay}
onSelect={setSelectedDay}
footer={footer}
/>
);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
