DioxusLabs / DioxusLabs/dioxus

Route Field Values Are Not Included If Not Specified In Path

Open
#3,873 0 comments 0 reactions 0 assignees View on GitHub
bug router
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Route field values are not included if not specified in the path.

E.g. assuming `Main` and `Epub` exist. The following compiles

```rust
#[derive(Debug, Clone, Routable, PartialEq)]
#[rustfmt::skip]
enum Route {
#[route("/")]
Main {},
#[route("/epub")]
Epub { data: Vec }
}
```
And came be used like
```rust
use_navigator().push(Route::Epub { data: vec![1] });
```
But on the resulting epub component, the data is empty.

This should work or `Routable` should panic at compile time indicating that `data` needs to be included in the path.

**Environment:**

- Dioxus version: 0.6.3
- Rust version: 1.86.0-nightly
- OS info: Nixos 24.11
- App platform: desktop

**Questionnaire**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.