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
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I am curious why
useOutletContexthas 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