From 5cfa1c7c8490127981b9172db50062437b977918 Mon Sep 17 00:00:00 2001 From: Alexey Taktarov Date: Mon, 11 Mar 2024 10:58:13 +0100 Subject: [PATCH] Document `hrefs` prop. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 646b95d..01e6b48 100644 --- a/README.md +++ b/README.md @@ -516,7 +516,7 @@ fetchOrders().then((orders) => { }); ``` -### `` +### `` 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 @@ -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 `` 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?