Skip to content

The trait bound impl yew::functional::hooks::Hook<Output = stylist::Style> + '_: yew::Hook is not satisfied #158

@Android789515

Description

@Android789515

My code

use yew::{
    function_component,
    Html,
    html,
};

use stylist::yew::use_style;

#[function_component]
pub fn App() -> Html {

    let styles = use_style!("color: red;");

    html! {
        <div class={styles}>
        </div>
    }
}

Example from Docs

use stylist::yew::use_style;
use yew::prelude::*;

#[function_component(Comp)]
fn comp() -> Html {
    // Returns a Style instance.
    let style = use_style!("color: red;");
    html! {<div class={style}>{"Hello world!"}</div>}
}

I get this error

the trait bound `impl yew::functional::hooks::Hook<Output = stylist::Style> + '_: yew::Hook` is not satisfied

the trait `yew::Hook` is implemented for `yew::BoxedHook<'_, T>`

(E0277)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions