Skip to content

Add non-exhaustive to the derived props in #[component]#5422

Open
ealmloff wants to merge 1 commit intoDioxusLabs:mainfrom
ealmloff:non-exhaustive
Open

Add non-exhaustive to the derived props in #[component]#5422
ealmloff wants to merge 1 commit intoDioxusLabs:mainfrom
ealmloff:non-exhaustive

Conversation

@ealmloff
Copy link
Copy Markdown
Member

Currently it is a breaking change to add an optional field to a public component with props derived with the #[component] macro even though it isn't breaking for usage within rsx. This PR adds non_exhaustive to the derived props so it isn't breaking in future releases.

Changing this component:

#[component]
pub fn Button() -> Element {...}

To this:

#[component]
pub fn Button(color: Option<String>) -> Element {...}

Is breaking because there is a public generated ButtonProps with public fields that could be constructed manually

@ealmloff ealmloff requested a review from a team as a code owner March 27, 2026 20:33
@ealmloff ealmloff added core relating to the core implementation of the virtualdom breaking This is a breaking change labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking This is a breaking change core relating to the core implementation of the virtualdom

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant