You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{useState}from'react';import{DayPicker}from'react-day-picker';import'react-day-picker/style.css';constDAY_IN_MS=24*60*60*1000;functionApp(){const[range,setRange]=useState({from: newDate(),to: newDate(),});constchangerPrev=()=>{setRange({from: newDate(range.from.getTime()-DAY_IN_MS),to: range.to,});};return(<><buttononClick={()=>changerPrev()}>prev</button>{/* it doesn't work */}<DayPickermode="range"selected={range}/>{/* it work */}<DayPickermode="range"selected={range}onSelect={()=>void0}/></>);}exportdefaultApp;
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.
To reproduce
stackblitz Link: https://stackblitz.com/edit/vitejs-vite-rdyvfyjg?file=src%2FApp.tsx
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
2025-02-28.10.12.56.mov