Skip to main content

props_builder

Function props_builder 

Source
pub fn props_builder<P, F>(_component: &F) -> P::Builder
where P: Props, F: for<'a, 's, 'u> Fn(&'a mut Cx<'s, 'u>, P),
Expand description

Get the props builder for a component function.

A function item’s type cannot be named, so rsx! passes the function by reference and lets the Fn bound infer the props type: <Counter/> becomes Counter(cx, props_builder(&Counter)..build()) and the user only has to use the component itself.