DioxusLabs/dioxus · error · syn::Error

Props is not supported for unit structs

Error message

Props is not supported for unit structs

What it means

Error "Props is not supported for unit structs" thrown in DioxusLabs/dioxus.

Source

Thrown at packages/core-macro/src/props/mod.rs:59

                let build_method = struct_info.build_method_impl();

                quote! {
                    #builder_creation
                    #conversion_helper
                    #( #fields )*
                    #( #extends )*
                    #( #required_fields )*
                    #build_method
                }
            }
            syn::Fields::Unnamed(_) => {
                return Err(Error::new(
                    ast.span(),
                    "Props is not supported for tuple structs",
                ));
            }
            syn::Fields::Unit => {
                return Err(Error::new(
                    ast.span(),
                    "Props is not supported for unit structs",
                ));
            }
        },
        syn::Data::Enum(_) => {
            return Err(Error::new(ast.span(), "Props is not supported for enums"));
        }
        syn::Data::Union(_) => {
            return Err(Error::new(ast.span(), "Props is not supported for unions"));
        }
    };
    Ok(data)
}

mod util {
    use quote::ToTokens;

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/core-macro/src/props/mod.rs:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/249ff02676aef0db. Report an issue: GitHub.