T
TanStack3w ago
relaxed-coral

Is it okay to use the private "url" property on router.buildLocation()?

I use router rewrites to convert paths such as /app/workspace to be re-written to a subdomain such as app.mydomain.com/workspace I need to occasionally generate external urls for emails that use routes from my app. When I call buildLocation({ to: "/app/workspace" }) tanstack router correctly re-writes my url and populates a property called url in the ParsedLocation type. But this property is marked as private? https://github.com/TanStack/router/blob/04671971ad7b8ee97449a993207ba2edf9d1f2ee/packages/router-core/src/router.ts#L1149
(property) ParsedLocation<{}>.url: string
@private
@description — The full URL of the location, including the origin.
@private
(property) ParsedLocation<{}>.url: string
@private
@description — The full URL of the location, including the origin.
@private
I was curious if it's okay to use this property to build the external URL I need or is this actually an internal implementation detail and subject to change any time? This is exactly what I need, and unsure how to create something similar without it, also just curious why it's private? thanks!
GitHub
router/packages/router-core/src/router.ts at 04671971ad7b8ee97449a9...
🤖 A client-first, server-capable, fully type-safe router and full-stack framework for the web (React and more). - TanStack/router
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?