Skip to content

Support for conditional html elements: Option<VNode> should work inside html macro #1038

@Boscop

Description

@Boscop

Please support conditional html elements by allowing Option<VNode> inside the html macro, so that the following compiles:

html! {
	<div>
		{
			condition.then(|| html! {
				<span>{"foo"}</span>
			})
		}
	</div>
}

(This example uses bool::then to turn a bool into an Option<VNode> but that's just an example how I use it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions