You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to specify query parameters when navigating to a new route, use either `navigator.push_with_query` or
351
-
the `navigator.replace_with_query` functions. It uses `serde` to serialize the parameters into a query string for the URL so
352
-
any type that implements `Serialize` can be passed. In its simplest form, this is just a `HashMap` containing string
353
-
pairs.
351
+
the `navigator.replace_with_query` functions. It uses the `ToQuery` trait to serialize the parameters into a query string for the URL. The `ToQuery` trait is automatically implemented for `serde` so any type that implements `Serialize` can be passed. In its simplest form, this is just a `HashMap` containing string pairs. In more complex scenarios the `ToQuery` trait can be implemented manually for a custom query format.
354
352
355
353
#### Obtaining query parameters for the current route
356
354
357
-
`location.query` is used to obtain the query parameters. It uses `serde` to deserialize the parameters from the query string
358
-
in the URL.
355
+
`location.query` is used to obtain the query parameters. It uses the `FromQuery` trait to deserialize the parameters from the query string
356
+
in the URL. The `FromQuery` trait is automatically implemented for `serde` so any type that implements `Deserialize` can be passed. If the URL is formatted in an custom way, a manual implementation of `FromQuery` can be used.
0 commit comments