DioxusLabs / DioxusLabs/dioxus

Make behaviour of `match` match other control structures

Open
#2,594 0 comments 0 reactions 0 assignees View on GitHub
rsx syntax
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Feature Request

Currently `match` behaviour does not match other control structures:

```rust
if let Foo = bar {
div {
// ...
}
}
```

but

```rust
match bar {
Foo =>
rsx! {
div {
// ....
}
},
}
```

`match` should behave as `if` or `for`:

```rust
match bar {
Foo =>
div {
// ....
},
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the RSX parser or expansion handles `if`, `for`, and `match` control structures. Compare the existing `match` behavior with the examples in the issue; done means a match arm can contain RSX directly, like the shown `if` and `for` forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.