[React] DatePicker/DatePickerInput does not re-render on the change of minDate/maxDate prop
See original GitHub issueWhat package(s) are you using?
-
carbon-components-react
Detailed description
DatePicker/DatePickerInput is not re-rendering after minDate/maxDate param values are updated.
Steps to reproduce the issue
- On the codesandbox page below, select a “From” from the first date picker. Lets call it Today.
- Now try selecting a “To” date from the second date picker. This control should have kept me from selecting a date before Today.
Reason
I am aware of the range type of the datepicker, however in my context users need to select time range in addition to the date range hence I am using individual datepickers for From and To dates.
Link for CodeSandBox
Please take a look at the codesandbox link to view the bug in action CodeSandBox Link
- Notes The props do work if a value is already set for the minDate and maxDate on the component load. However, it doesn’t update when the values update.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Why React component doesn't re-render (change styles) when ...
The reason I figured out is that its state doesn't change even when prop isSelected changes. I don't know why this happens. Does...
Read more >How and when to force a React component to re-render
This demo doesn't work because props are a reflection of state, so a standalone change in props won't trigger a re-render. To fix...
Read more >Re-rendering Components in ReactJS - GeeksforGeeks
Rendering components is not in user hands, it is a part of React Component ... re-render whenever there is a change in their...
Read more >How to check if your component rerendered - and why!
"Props changed"; "State changed"; "The parent component rendered." You'll notice that sometimes the reason is not very detailed - simply saying ...
Read more >A Visual Guide to React Rendering - It Always Re-renders
Contrary to popular belief, by default, react component doesn't care whether its props changed or not. It will always re-render when its ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks it worked.
Duplicate of: #2500