Closed juliogarciag closed 8 months ago
Fixed in v0.4.1
Hi @kiliman I'm afraid I'm still getting this with 0.4.1 (with Remix 2.4.1 or 2.5.0)
Any ideas?
Error: useLoaderData must be used within a data router. See https://reactrouter.com/routers/picking-a-router.
at Object.invariant [as UNSAFE_invariant] (node_modules/remix-typedjson/node_modules/@remix-run/react/node_modules/@remix-run/router/history.ts:494:11)
at useDataRouterState (node_modules/remix-typedjson/node_modules/@remix-run/react/node_modules/react-router/lib/hooks.tsx:838:3)
at Object.useLoaderData (node_modules/remix-typedjson/node_modules/@remix-run/react/node_modules/react-router/lib/hooks.tsx:909:15)
at useLoaderData (node_modules/remix-typedjson/node_modules/@remix-run/react/dist/components.js:684:25)
at Module.useTypedLoaderData (node_modules/remix-typedjson/dist/remix.js:82:44)
at… (my route)
Do you have a sample repo? It's kind of hard to say what the issue is without some code.
This commit removes
@remix-run/react
as peer dependency: https://github.com/kiliman/remix-typedjson/commit/30f96e9670ab1602fd8a9e97546248481c986e1a. This made the use ofuseTypedLoaderData
to throw this error:Going back to 0.3.1 removed the error.