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

error[E0277]: the trait bound TableItem: From<VNode> is not satisfied #47

Open
theavege opened this issue Aug 30, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@theavege
Copy link

Summary

Hello.

I get error "error[E0277]: the trait bound TableItem: From<VNode> is not satisfied" about this code

use {
    yew::{function_component, html, Html},
    yew_and_bulma::elements::table::{Table, TableData, TableRow},
};

#[function_component]
pub fn Other() -> Html {
    let education = [
        ["OneOne", "OneTwo"],
        ["TwoOne", "TwoTwo"],
    ];
    html! {
        <Table full_width=true> { education.iter().map(|row| html! {
            <TableRow> {
                row.iter().map(|col| html! {
                    <TableData>{col}</TableData>
                }).collect::<Html>()
            } </TableRow>
        }).collect::<Html>()} </Table>
    }
}

Steps to reproduce

use {
    yew::{function_component, html, Html},
    yew_and_bulma::elements::table::{Table, TableData, TableRow},
};

#[function_component]
pub fn Other() -> Html {
    let education = [
        ["OneOne", "OneTwo"],
        ["TwoOne", "TwoTwo"],
    ];
    html! {
        <Table full_width=true> { education.iter().map(|row| html! {
            <TableRow> {
                row.iter().map(|col| html! {
                    <TableData>{col}</TableData>
                }).collect::<Html>()
            } </TableRow>
        }).collect::<Html>()} </Table>
    }
}

Expected behaviour

I expect not to get this error.

Actual behaviour

I am getting this error.

Version

0.4.0

What browsers are you seeing the problem on?

No response

Relevant log output

error[E0277]: the trait bound `TableItem: From<VNode>` is not satisfied
  --> app/front/example/src/pages/other.rs:13:35
   |
13 |         <Table full_width=true> { education.iter().map(|row| html! {
   |                                   ^^^^^^^^^ the trait `From<VNode>` is not implemented for `TableItem`
   |
   = help: the following other types implement trait `From<T>`:
             <TableItem as From<VChild<yew_and_bulma::elements::table::TableData>>>
             <TableItem as From<VChild<yew_and_bulma::elements::table::TableFooter>>>
             <TableItem as From<VChild<yew_and_bulma::elements::table::TableHeader>>>
             <TableItem as From<VChild<yew_and_bulma::elements::table::TableRow>>>
   = note: required because of the requirements on the impl of `Into<TableItem>` for `VNode`
   = note: required because of the requirements on the impl of `From<VNode>` for `NodeSeq<VNode, TableItem>`
   = note: 1 redundant requirement hidden
   = note: required because of the requirements on the impl of `Into<NodeSeq<VNode, TableItem>>` for `VNode`
   = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
@theavege theavege added the bug Something isn't working label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant