Skip to content

Commit

Permalink
Document hrefs prop.
Browse files Browse the repository at this point in the history
  • Loading branch information
molefrog committed Mar 11, 2024
1 parent 62060a1 commit 5cfa1c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -516,7 +516,7 @@ fetchOrders().then((orders) => {
});
```

### `<Router hook={hook} parser={fn} base={basepath} />`
### `<Router hook={hook} parser={fn} base={basepath} hrefs={fn} />`

Unlike _React Router_, routes in wouter **don't have to be wrapped in a top-level component**. An
internal router object will be constructed on demand, so you can start writing your app without
Expand Down Expand Up @@ -553,6 +553,8 @@ available options:

- **`ssrPath: string`** and **`ssrSearch: string`** use these when [rendering your app on the server](#server-side-rendering-support-ssr).

- `hrefs: (href: boolean) => string` — a function for transforming `href` attribute of an `<a />` element rendered by `Link`. It is used to support hash-based routing. By default, `href` attribute is the same as the `href` or `to` prop of a `Link`. A location hook can also define a `hook.hrefs` property, in this case the `href` will be inferred.

## FAQ and Code Recipes

### I deploy my app to the subfolder. Can I specify a base path?
Expand Down

0 comments on commit 5cfa1c7

Please sign in to comment.