Skip to content

Commit

Permalink
dont add ssr signal on client side navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecAivazis committed Oct 19, 2023
1 parent f95ae8a commit 8ffb836
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/houdini-react/src/runtime/routing/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export function Router({
return initialURL || window.location.pathname
})

console.log({ current })

// find the matching page for the current route
const [page, variables] = find_match(manifest, current)

Expand Down Expand Up @@ -122,7 +120,7 @@ export function Router({
// its needs
return (
<VariableContext.Provider value={variables}>
<PageComponent url={current} />
<PageComponent url={current} key={page.id} />
</VariableContext.Provider>
)
}
Expand Down Expand Up @@ -261,8 +259,15 @@ function usePageData({
.catch(reject)
})

// add it to the pending cache
ssr_signals.set(id, { ...promise, resolve, reject })
// if we are on the server, we need to save a signal that we can use to
// communicate with the client when we're done
const resolvable = { ...promise, resolve, reject }
if (!globalThis.window) {
ssr_signals.set(id, resolvable)
}

// we're done
return resolvable

// this promise is also what we want to do with the main invocation
return ssr_signals.get(id)!
Expand Down

0 comments on commit 8ffb836

Please sign in to comment.