In React Router, you can pass data from one route (component) to another by encoding it in the location state or URL parameters. Sibling components—being separate routes under the same parent—can share data this way without lifting state all the way up.
Location State 📦
When you navigate (via <Link> or useNavigate), you can include a state object:
The target component uses useLocation() to read location.state.foo.
URL Parameters 🔗
When to Use Which 🎯