GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
This is an example of how we could achieve react-router data loaders with urql.
🕵️ Details
Since loaders are regular functions, we cannot use hooks in them. So, we instead get the client in the router and pass it into a builder that returns the loader.
🧪 Testing
Build the app pnpm run dev:fresh
Login as any user
Confirm the dashboard loads correctly
Navigate away and then return
Notice the query is re-run every time even though it should be near instant read from cache
👋 Introduction
This is an example of how we could achieve
react-router
data loaders withurql
.🕵️ Details
Since loaders are regular functions, we cannot use hooks in them. So, we instead get the client in the router and pass it into a builder that returns the loader.
🧪 Testing
pnpm run dev:fresh