The `selected` prop is not working without setting `onSelect`
- Dominant language
- TypeScript
- Stars
- 6.9k
- Forks
- 780
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 3
Description
## To reproduce
**stackblitz Link**: https://stackblitz.com/edit/vitejs-vite-rdyvfyjg?file=src%2FApp.tsx
```tsx
import { useState } from 'react';
import { DayPicker } from 'react-day-picker';
import 'react-day-picker/style.css';
const DAY_IN_MS = 24 * 60 * 60 * 1000;
function App() {
const [range, setRange] = useState({
from: new Date(),
to: new Date(),
});
const changerPrev = () => {
setRange({
from: new Date(range.from.getTime() - DAY_IN_MS),
to: range.to,
});
};
return (
<>
changerPrev()}>prev
{/* it doesn't work */}
{/* it work */}
void 0} />
);
}
export default App;
```
## Actual Behavior
In the first case, the selected value does not change.
In the second case, the selected value changes.
## Expected Behavior
In both the first and second cases, the selected value should change.
## Screenshots
Contributor guide
Assessment
This issue has not been assessed yet.