Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Android789515 opened this issue Oct 5, 2024 · 0 comments

Comments

@Android789515
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant