Lift-Off III | 8. The useQuery Hook | without useParams?

Cheers!

The the trackId variable is being passed into the Track component on page load, then used as a variable for the useQuery hook. It’s obviously being pulled from the Route’s url /:trackId since I can navigate directly to the page, and the component receives the trackId as a prop.

But, how the heck is the component getting the trackId variable without a useParams hook from react-router?

Ah, I’ve discovered the culprit. This tutorial doesn’t use React Router, it uses Reach Router. Foiled by the letter ‘h’!

Hello @amunrarara , indeed the demo does uses reach-router, not react-router. The subtle name difference is a bit misleading I agree. Things evolved on those libs since we built the demo, so we’ll update it in the future, though nothing planned short term.