tally-core writes a view to a query string and reads it back. useViewUrl in tally-react keeps the two in sync.
In React
accounts.tsx
popstate restores the view of the history entry. The hook touches window only inside effects, so it is safe to render on the server.
The format
q. The other parameters are written only when they differ from the schema’s default view.
state is JSON encoded as base64url. It is the only part that is not readable. It is checked with validateView when read, so viewFromUrlString throws on a blob that does not match the view shape. useViewUrl catches it and keeps the current view.
Other parameters in the query string are left alone. Commas, colons, parentheses and slashes stay unescaped so the link stays readable.
Without React
param changes the name of the query text parameter. base is a query string or URLSearchParams whose other parameters are kept.
links.ts
q are not raised. The view gets the query parseQuery built from the text.
See Views for the view object and the view store.