diff --git a/README.md b/README.md index 42eee4c..d306eea 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ projects that use wouter: **[Ultra](https://ultrajs.dev/)**, - [``](#link-hrefpath-) - [``](#switch-) - [``](#redirect-topath-) - - [``](#router-hookhook-matchermatchfn-basebasepath-) + - [``](#router-hookhook-parserfn-basebasepath-) - [FAQ and Code Recipes](#faq-and-code-recipes) - [I deploy my app to the subfolder. Can I specify a base path?](#i-deploy-my-app-to-the-subfolder-can-i-specify-a-base-path) @@ -499,6 +499,14 @@ behaviour needs to be customized. These cases include hash-based routing, basepath support, custom matcher function etc. +```jsx +import { useHashLocation } from "wouter/use-hash-location"; + + + {/* Your app goes here */} +; +``` + A router is a simple object that holds the routing configuration options. You can always obtain this object using a [`useRouter` hook](#userouter-accessing-the-router-object). The list of currently available options: @@ -510,6 +518,8 @@ available options: Read more → [Customizing the location hook](#customizing-the-location-hook). +- **`searchHook: () => [search: string, setSearch: fn]`** — similar to `hook`, but for obtaining the [current search string](#usesearch-query-strings). + - **`base: string`** — an optional setting that allows to specify a base path, such as `/app`. All application routes will be relative to that path. To navigate out to an absolute path, prefix your path with an `~`. [See the FAQ](#are-relative-routes-and-links-supported). @@ -517,6 +527,8 @@ Read more → [Customizing the location hook](#customizing-the-location-hook). function. Produces a RegExp for matching the current location against the user-defined patterns like `/app/users/:id`. Has the same interface as the [`parse`](https://github.com/lukeed/regexparam?tab=readme-ov-file#regexparamparseinput-regexp) function from `regexparam`. See [this example](#are-strict-routes-supported) that demonstrates custom parser feature. +- **`ssrPath: string`** and **`ssrSearch: string`** use these when [rendering your app on the server](#server-side-rendering-support-ssr). + ## FAQ and Code Recipes ### I deploy my app to the subfolder. Can I specify a base path?