I've got a question!

I have an app where I use Zustand for my state management. For example I have states for the currentProject, current dataset and current view which decides what it shown.

I now want to add routing and I'm not sure what should be the "source of truth" now.

Should I change the state and have a hook that then navigates me according to the state to the specific dataset or project?

This would mean state is the source of truth. That leads to problems when I want to make browser navigation work or when I want to open a link with dataset in it since the state is empty i need to allow state -> url once on initialization?

Or should I use url first. So Everytime I open a url the app loads the dataset from the url in the state?

I hope it's clear what I wanna know. Thanks in advance!