How to construct the first parameter of a function without calling it?

⚓ Rust    📅 2025-09-01    👤 surdeus    👁️ 3      

surdeus

AFAIK Dioxus components are type-checked normally, so it doesn't make sense that, when components are rendered thru rsx!, they simply receive dynamic properties.

I thought maybe under the hood Dioxus converts the component's parameters into a dynamic type, but this is probably wrong (because I've seen you don't always wrap your Dioxus component into a #[component] attribute). And if that was done, there'd be no type-checking for attributes, then.

pub enum Node<T> {
    Component {
        component: Rc<dyn Fn(DynParams)>,
        params: DynParams,
    },
}

1 post - 1 participant

Read full topic

🏷️ Rust_feed