Skip to content

Commit

Permalink
HashRouter NoSlash tests and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Whaileee committed Mar 14, 2024
1 parent 6527b22 commit 83efd3b
Show file tree
Hide file tree
Showing 13 changed files with 445 additions and 236 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,4 @@
- yracnet
- yuleicul
- zheng-chuang
- Whaileee
17 changes: 17 additions & 0 deletions docs/router-components/hash-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ declare function HashRouter(

interface HashRouterProps {
basename?: string;
hashType?: HashType
children?: React.ReactNode;
future?: FutureConfig;
window?: Window;
Expand Down Expand Up @@ -55,6 +56,22 @@ function App() {
}
```

## `hashType`

Decide wether to put a slash after the '#' in the URL (default: 'slash')

```jsx
function App() {
return (
<HashRouter hashType='noslash'>
<Routes>
<Route path="/bookmark" /> {/* 👈 Renders at /#bookmark/ */}
</Routes>
</HashRouter>
);
}
```

## `future`

An optional set of [Future Flags][api-development-strategy] to enable. We recommend opting into newly released future flags sooner rather than later to ease your eventual migration to v7.
Expand Down

0 comments on commit 83efd3b

Please sign in to comment.