react-router icon indicating copy to clipboard operation
react-router copied to clipboard

Substitute params from current route params

Open xepozz opened this issue 3 years ago • 3 comments

Thanks to the functionality users can write their proxy routes like the following: current: /path/:param1/subpath/:param2

navigate to: /newpath/:param1/newsubpath/:param2

It also helps to find routes because you may find the route definition just by text /user/:id instead of preparing /user/${id} for the search.

My main reason of the functionality is to make proxies like in the test. I want to cut off the history by proxying to the app from outside. The following code

<Route path="proxy/to/:somewhere" element={<Navigate replace autoSubstitute to=":somewhere" />} />

will satisfy me.

I'm open to discuss the new parameter or move it into useNavigate if you want. Thanks!

xepozz avatar Nov 01 '22 16:11 xepozz

⚠️ No Changeset found

Latest commit: 8fc606ea188c300faf6a7828aab06a4207690478

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 01 '22 16:11 changeset-bot[bot]

Hi @xepozz,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

remix-cla-bot[bot] avatar Nov 01 '22 16:11 remix-cla-bot[bot]

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

remix-cla-bot[bot] avatar Dec 05 '22 20:12 remix-cla-bot[bot]

We're doing some house cleaning to start the new year. We switched to a new Open Development process recently so new features should go through that process. Do you mind creating a new Discussion with the Proposals label requesting this feature? Please link to this PR in there so it can be leveraged or re-opened if the proposal gets accepted. Thank you!

brophdawg11 avatar Jan 09 '23 23:01 brophdawg11