Skip to content

feat(fullstack-server): add router_with_state<S>#5401

Closed
Mr-KRAMA wants to merge 1 commit intoDioxusLabs:mainfrom
Mr-KRAMA:feat/router-with-state-5394
Closed

feat(fullstack-server): add router_with_state<S>#5401
Mr-KRAMA wants to merge 1 commit intoDioxusLabs:mainfrom
Mr-KRAMA:feat/router-with-state-5394

Conversation

@Mr-KRAMA
Copy link
Copy Markdown

@Mr-KRAMA Mr-KRAMA commented Mar 22, 2026

… state (#5394)
This PR adds a new router_with_state function to dioxus::server that allows attaching custom Axum state to the Dioxus router. The existing router() returns a Router<()>, which prevents the use of .with_state(...) since the state type is already fixed. The new function builds the router the same way as router() (including SSR, static assets, server functions, and base path handling) and then merges it into a Router, enabling users to provide their own state. This change is fully backward compatible, as it introduces a new optional API without modifying existing behavior.

@Mr-KRAMA Mr-KRAMA requested a review from a team as a code owner March 22, 2026 05:56
@Mr-KRAMA Mr-KRAMA closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant