Prerequisites
Issue
|
// If we have a getData function registered for this route |
|
if (!ctx.data && ctx.getData) { |
|
try { |
|
const { pathname, search } = location |
|
// If not, fetch data from the JSON endpoint |
|
ctx.data = waitFetch(`/-/data${pathname}${search}`) |
|
} catch (status) { |
|
// If it's an actual error... |
|
if (status instanceof Error) { |
|
ctx.error = status |
|
} |
|
// If it's just a promise (suspended state) |
|
throw status |
|
} |
|
} |
I was able to confirm that a request was made to '/-/data/path' whenever window.hash changed.
I thought that the request would not be made because hash is not a route change.
Prerequisites
Issue
fastify-vite/packages/fastify-react/virtual/core.jsx
Lines 81 to 95 in 7e360ad
I was able to confirm that a request was made to
'/-/data/path'wheneverwindow.hashchanged.I thought that the request would not be made because hash is not a route change.