T
TanStack2y ago
united-yellow

setting the selected value in a dropdown to the newly created value

I have a select which shows a list of views. When I create a new view, I want the selected value in the select to be the new view. I don't need it to be optimistic since it would be a bit of an overkill. Should I be storing the state of the new view from the response (in newView for example) until the refetch of the views and then set the state of the selected view to the view with the id newView? Any other approach? If it were optimistic, what would the approach be?
1 Reply
sensitive-blue
sensitive-blue2y ago
Just do it. Many ways will work

Did you find this page helpful?