next-rs / input-yew

A feature-rich, accessible, highly customizable, functional, reusable input component for Yew and You, btw.
https://docs.rs/input-yew
Apache License 2.0
4 stars 1 forks source link

CustomInput yew::Component not satisfied #3

Closed ioleo closed 11 months ago

ioleo commented 11 months ago

Hi, thanks for all the effort creating this library, it looks really promising! I'm trying to use CustomInput however I'm getting:

the trait bound `CustomInput: yew::Component` is not satisfied

input_yew: 0.1.7 yew: 0.21

PS. I'm new to Rust and Yew, so perhaps I'm missing something obvious.

ioleo commented 11 months ago

My code:

#[function_component(ContactForm)]
pub fn contact_form() -> Html {
    let label_class = "block text-slate-300 text-sm font-bold mb-2";
    let input_class = "input input-bordered w-full text-slate-700";

    let input_name_handle = use_state(String::default);
    let input_name_ref = use_node_ref();

    html! {
      <section class="section">
        <p class="text-3xl">{ "Kontakt z autorką" }</p>
        <form class="shadow-md rounded md:px-8 pt-6 mb-4">
          <div class="mb-6">
            <label class={ label_class }>{ "Imię lub ksywka"}</label>
            <CustomInput
              input_type={"text".to_string()}
              input_handle={input_name_handle}
              name={"name".to_string()}
              input_ref={input_name_ref}
              input_placeholder={"Jak mam się do Ciebie zwracać?".to_string()}
              form_input_input_class={input_class}
            />
          </div>
        </form>
      </section>
    }
}
wiseaidev commented 11 months ago

Hey @ioleo, thanks for filing this issue. This library currently supports yew 0.20:

https://github.com/wiseaidev/input-yew/blob/40fee5014aaacac076015a1d478145c5b2ebdf62/Cargo.toml#L17

yew 0.21, apparently, introduced breaking changes related to props. I will try my best to ship a new release today.

Love, Mahmoud

Edit: :clinking_glasses: