You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#444 from @BadMannersXYZ got me thinking. I currently use maud like JSX, in that I define components like this:
fnmy_custom_form(...) -> Markup{html!{ form { .. }}}// laterfnmain_view() -> Markup{html!{(my_custom_form())}}
In React-land, I'd write:
<MyCustomForm/>
Now my problem is that I'd like to add custom classes and attributes to my "component" from the caller side. <form class="foobar"> for example. In JSX, I'd write:
<MyCustomFormclassName="foobar" />
And the MyCustomForm would forward all props to the underlying form element.
How about this API in Rust?
fnmy_custom_form(attrs: maud::Attributes) -> Markup{html!{
form (..attrs){ .. }}}fnmain_view() -> Markup{html!{(my_custom_form(maud::attributes!(.foobar)))}}
maud could expose alternative ways to construct maud::Attributes as well, and solve usecases related to #444 as well in one go.
The text was updated successfully, but these errors were encountered:
#444 from @BadMannersXYZ got me thinking. I currently use maud like JSX, in that I define components like this:
In React-land, I'd write:
Now my problem is that I'd like to add custom classes and attributes to my "component" from the caller side.
<form class="foobar">
for example. In JSX, I'd write:And the MyCustomForm would forward all props to the underlying form element.
How about this API in Rust?
maud could expose alternative ways to construct
maud::Attributes
as well, and solve usecases related to #444 as well in one go.The text was updated successfully, but these errors were encountered: