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

Feat: proper rendering of href when using useHashLocation #421

Merged
merged 4 commits into from
Mar 11, 2024

Conversation

molefrog
Copy link
Owner

Closes #392 #215

A long-awaited feature that makes it possible to have proper hrefs with the leading # when hash location is used. You can customise the formatter manually:

<Router hrefs={(href) => "#" + href} />

Or, it can be detected automatically when useHashLocation is used.

Copy link

stackblitz bot commented Feb 27, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

github-actions bot commented Feb 27, 2024

size-limit report 📦

Path Size
packages/wouter/esm/index.js 2.14 KB (+1.02% 🔺)
packages/wouter/esm/use-browser-location.js 658 B (0%)
packages/wouter/esm/memory-location.js 834 B (0%)
packages/wouter/esm/use-hash-location.js 749 B (+1.63% 🔺)
packages/wouter-preact/esm/index.js 2.02 KB (+1.08% 🔺)
packages/wouter-preact/esm/use-browser-location.js 552 B (0%)
packages/wouter-preact/esm/use-hash-location.js 618 B (+1.82% 🔺)
packages/wouter-preact/esm/memory-location.js 702 B (0%)

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6815e69) to head (7546d1a).

❗ Current head 7546d1a differs from pull request most recent head 7d06bd6. Consider uploading reports for the commit 7d06bd6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##                v3      #421   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            1         1           
=========================================
  Hits             1         1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@jeetiss jeetiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅

@molefrog molefrog merged commit 5cfa1c7 into v3 Mar 11, 2024
2 checks passed
@molefrog molefrog deleted the feat/hash-links branch March 11, 2024 09:59
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

Successfully merging this pull request may close these issues.

v3.0.0-rc.1: When use hash router, Ctrl+click on <Link>, new window is opened with wrong url
2 participants