Good morning. I'm running into an issue with the M...
# compose
r
Good morning. I'm running into an issue with the Material 3 Compose
DatePicker
not not updating the selectable dates when
validDates
changes. I was able to force a composition of a new
DatePicker
with
key
but is there a better way or am I doing it wrong? Thanks!
m
The lambda passed to
dateValidator
is capturing the original
validDates
property.
rememberUpdatedState
can be helpful for that.
r
rememberUpdatedState: reference a value in an effect that shouldn't restart if the value changes
. The problem is that it's not re-composing when
validDates
changes which changes
dateValidator
.
m
I haven't played with DatePicker, but this is a common problem, I've had with lambdas and captured values, so I don't know if it will fix your problem or not.
r
I did try it for kicks and it had the same bug.