(On android) When I switch the Switch e.g. from off to on, it firstly turns to on for a brief moment then off again and then finally on, this is probably caused by the fact that the switches are directly bound to the server data.
Use the "Optimistic updates" pattern here and add an intermediate front end state layer, the Switch would directly switch to the desired value, and we would only handle an erroneous response (a mismatch between the backend and frontend data)
(On android) When I switch the Switch e.g. from off to on, it firstly turns to on for a brief moment then off again and then finally on, this is probably caused by the fact that the switches are directly bound to the server data.
Use the "Optimistic updates" pattern here and add an intermediate front end state layer, the Switch would directly switch to the desired value, and we would only handle an erroneous response (a mismatch between the backend and frontend data)
Try: https://tanstack.com/query/latest/docs/react/guides/optimistic-updates