I don't understand how to spread attributes #4214
Answered
by
gbj
DimitriTimoz
asked this question in
Q&A
-
I have those components #[component]
fn BaseInput(
r#type: String,
) -> impl IntoView {
view! {
<input type={r#type} class="border p-2 rounded"/>
}
}
#[component]
pub fn TextInput() -> impl IntoView {
view! {
<BaseInput r#type="text".to_owned() />
}
} How to be able to set a value signal of any type on the |
Beta Was this translation helpful? Give feedback.
Answered by
gbj
Aug 7, 2025
Replies: 1 comment 2 replies
-
What do you mean? There is only one element in this example; it will be added to the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to spread attributes onto a component and want to apply those attributes to something other than "all top-level elements," use
AttributeInterceptor
.