How to write the custom hook 'useStateQuery' similar to Nuqs for '@tanstack/react-router'. - TanStack