Fix typo / formatting in Params and Queries (#224)

This commit is contained in:
Quinten Konyn
2025-10-01 15:02:53 -07:00
committed by GitHub
parent da5f55e53a
commit a2597a8a1d

View File

@@ -42,7 +42,7 @@ struct ContactSearch {
Now we can use them in a component. Imagine a URL that has both params and a query, like `/contacts/:id?q=Search`.
The typed versions return `Memo<Result<T, _>>`. Its a Memo so it reacts to changes in the URL. Its a `Result` because the params or query need to be parsed from the URL, and may or may not be valid.
The typed versions return `Memo<Result<T, _>>`. Its a `Memo` so it reacts to changes in the URL. Its a `Result` because the params or query need to be parsed from the URL, and may or may not be valid.
```rust
use leptos_router::hooks::{use_params, use_query};
@@ -61,7 +61,7 @@ let id = move || {
};
```
The untyped versions return `Memo<ParamsMap>`. Again, its memo to react to changes in the URL. [`ParamsMap`](https://docs.rs/leptos_router/latest/leptos_router/params/struct.ParamsMap.html) behaves a lot like any other map type, with a `.get()` method that returns `Option<String>`.
The untyped versions return `Memo<ParamsMap>`. Again, its a `Memo` to react to changes in the URL. [`ParamsMap`](https://docs.rs/leptos_router/latest/leptos_router/params/struct.ParamsMap.html) behaves a lot like any other map type, with a `.get()` method that returns `Option<String>`.
```rust
use leptos_router::hooks::{use_params_map, use_query_map};