How to load data with react router dom v6 and handling errorpage?

This is probably not very different from constructing a client and passing it to <ApolloProvider>.
The pattern also appears to be react-router’s current recommendation.
There are [others who face the same problem of not being able to use hooks] github.com<>/remix-run/react-router/discussions/9856)…

Have a look at [this idea] github.com<>/remix-run/react-router/discussions/9861) being dicussed.

(Sorry for the broken links, I’m a new user who cannot post more than two links)