New to React Query - unsure how to deal with state management for a multi select search form
I have a form input that allows selecting of multiple users. It's a search input and the user types a username and submits the form, which fires a query that returns a user. This user is then added to a 'selected users' array. I need to display a list of these selected users in my form. What is the colloquial way to access the previous query state, given that the query changes and the
data only contains the user returned by the most recent query? I don't want to duplicate the selected users state in both my store and react query.