Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: useHref updates result from useResolvedPath #8133

Closed
fxOne opened this issue Oct 14, 2021 · 1 comment
Closed

[Bug]: useHref updates result from useResolvedPath #8133

fxOne opened this issue Oct 14, 2021 · 1 comment

Comments

@fxOne
Copy link

fxOne commented Oct 14, 2021

What version of React Router are you using?

v6.0.0-beta.6

Steps to Reproduce

I have the following sample:

return <Router basename="/_basePath">
  //...
  <Link to="/page1"/>
  //... 
</Router>;

Expected Behavior

I expected the following output:

<a href="/_basePath/page1"></a>

Actual Behavior

In some cases I get the following result as the Link component is rendered multiple times:

<a href="/_basePath/_basePath/_basePath/page1"></a>

The issue is that useHref is overwriting the reference which is returned from useResolvedPath and prepend the basepath multiple times:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant