Thanks, yeah that works for when the class is constructed, but not if you want to ensure the state is like that across multiple mounts. So yeah, seems like getDerivedStateFromProps
is the way forward for that use case.
Thanks, yeah that works for when the class is constructed, but not if you want to ensure the state is like that across multiple mounts. So yeah, seems like getDerivedStateFromProps
is the way forward for that use case.
I make UIs and such. Using JS mostly but I like to dabble.