This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on

Type Alias yew::html::ChildrenWithProps

source ·
pub type ChildrenWithProps<CHILD> = ChildrenRenderer<VChild<CHILD>>;
Expand description

A type used for accepting children elements in Component::Properties and accessing their props.


In this example, the List component can wrap ListItem components.

html! {
    <ListItem value="a" />
    <ListItem value="b" />
    <ListItem value="c" />

The List component must define a children property in order to wrap the list items. The children property can be used to filter, mutate, and render the items.

#[derive(Clone, Properties, PartialEq)]
struct ListProps {
    children: ChildrenWithProps<ListItem>,

impl Component for List {
            for ctx.props().children.iter().map(|mut item| {
                let mut props = Rc::make_mut(&mut item.props);
                props.value = format!("item-{}", props.value);

Aliased Type§

struct ChildrenWithProps<CHILD> { /* private fields */ }