TanStackT
TanStack4w ago
3 replies
sad-indigo

Parent beforeLoad being called when a child search param changes

I don't remember if this was always the case, but given the following routes:

/blog/posts.tsx
/blog/posts/$id.tsx (search params: showEditBanner: boolean)

If I update the search params using the following:

TS 
navigate({from: '/blog/posts/$id', to: '.', search: (prev) => ({...prev, showEditBanner: false});


Should the
beforeLoad
function in posts.tsx get called? It seems to be right now, but I'd prefer for it not to for performance reasons.
Was this page helpful?