React Router: <Replace the link pointing to auto generated useOutletContex docs>
Checks
- [x] This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- [x] I have thoroughly read and understand The Odin Project Contributing Guide
- [x] Would you like to work on this issue?
Describe your suggestion
In Outlets and State section of the lesson the link to useOutletContext docs points to auto generated documentation.
https://reactrouter.com/en/main/hooks/use-outlet-context
This is about as useful as you can imagine. I couldn't find anything on the v7.1.5 docs but the v6.29 docs have proper documentation for useOutletContext, so I suggest changing the link to this
https://reactrouter.com/6.29.0/hooks/use-outlet-context
Path
Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-react-new-react-router
(Optional) Discord Name
evilganesh
(Optional) Additional Comments
No response
I would also suggest replacing the sentence that recommends the Navigate component:
This is where we use the Navigate component.
Because the page in the docs that it links to says:
It's recommended to avoid using this component in favor of useNavigate
https://api.reactrouter.com/v7/functions/react_router.Navigate.html
Are we piling on work on Ganesh? Count me in
The lesson assignment also links to react router tutorial and mentions going up to the "Nested Routes" section. There's another section just below it called "Client Side Routing" that's relevant as well, so we could change the suggestion to read up to "Client Side Routing"
- The React Router tutorial goes through a lot of the stuff discussed in this lesson and much more. Have a read through the sections up to “Nested Routes”.
This is a trivial change, so I figured it would be best to include it in this PR while we're at it.
I wouldn't mind. There are more links that I didn't notice at first that seem to be auto generated docs too so they will need to be replaced with proper docs from v6.29.
Also agreed on "client side routing" section being relevant
@TheOdinProject/react Can someone take a look at this.
React Router v7 docs have since received a much needed upgrade.
v6-like guides have been added, albeit a little slimmer (though still sufficient).
The most appropriate replacement link IMO would be https://reactrouter.com/api/components/Outlet since that explains enough about outlet context and also links to useOutletContext.
The link to useOutletContext is pretty useless.
Returns the parent route <Outlet context> isn't clear enough to say if it is returning the context or the element, even if the Outlet page tells you to use useOutletContext to access context there is no example to demonstrate the use. So, I wouldn't count it relevant for now unless they update that page too in future.
The outlet page itself is fine and it explains you can pass the context with context prop, but I would prefer if we had example code that showed useOutletContext being used.
if we go with this change, I will advocate to put an example code for useOutletContext right inside the lesson.
That seems sensible to me
PR for this wasn't linked, but was merged today.
@KevinMulhern while the title of this issue mentions the link for useOutletContext, later in the discussion we realized that there are multiple other links like useNavigate, Link etc that point to auto generated docs. So while the link for useOutletContext is fixed those other links are still the same.
I can create another issue if that would be better.