HtmlElement::attrs
and DynAttrs::dyn_attrs
Accept &'static str
Instead of Oco<'static, str>
#2594
Labels
Milestone
Describe the bug
The
leptos_dom::html::HtmlElement::attrs
method does not acceptVec<(Oco<'static, str>, Attribute)>
.However, it will accept
Vec<(&'static str, Attribute)>
and will convertname
toOco<'static, str>
in theHtmlElement::attr
method.The same issue occurs with
leptos::DynAttrs::dyn_attrs
, which will only acceptVec<(&'static str, Attribute)>
.Leptos Dependencies
To Reproduce
Expected behavior
The method should accept
Vec<(Oco<'static, str>, Attribute)>
as a type for dynamic attributes.Additional context
I am working on Storybook integration for Leptos and parsing props for components from
JsValue
. Currently, it is impossible to use regular arguments, so I have to do something like this:The text was updated successfully, but these errors were encountered: