I have a sidebar with filters on my site. One of the filters is datetime (I am using the library react-advanced-datetimerange-picker).
If the browser screen size is changed, the sidebar disappears, but a button appears that can open it again. As soon as the screen sizes change and the sidebar closes (or opens), the calendar disappears and the entered data is also lost. I would like that the calendar and the entered data are not lost depending on the screen size.
I leave a link to the code. My problem is with the FilterDateTime.js file and the DateTimeRangeContainer component. That is, when the screen size is changed, the expanded state of the calendar and the entered data are not saved.
https://codesandbox.io/s/currying-wave-uoenvx
Can this problem be solved?
You need move your state to the parent of the sidebar component.
Please check.