Generic parameter for useLoaderData
, useRouteLoaderData
, useActionData
#10220
Unanswered
sgrishchenko
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am curious why
useOutletContext
has generic parameter for return type and other hook for retrieving data from routes or contexts (e.g.useLoaderData
,useRouteLoaderData
,useActionData
) does not have such generic parameter? It is inconsistent a little bit from my point of view. Do you consider a possibility to add such generics (or remove generic fromuseOutletContext
)? If so, I can create PR with such improvement.Links to declarations:
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L784
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L800
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/hooks.tsx#L808
Beta Was this translation helpful? Give feedback.
All reactions