Fwiw, to me, this feels cleaner than somehow duplicating the selectedPet state into a useRef.
Also, while the local selectedPet variable I used is not actually needed, I feel it reads better, but YMMV, using pets.selectedPet everywhere would work just as well. First diff would be reduced to:
Fwiw, to me, this feels cleaner than somehow duplicating the
selectedPet
state into auseRef
.Also, while the local
selectedPet
variable I used is not actually needed, I feel it reads better, but YMMV, usingpets.selectedPet
everywhere would work just as well. First diff would be reduced to: