Skip to content

Unable to use more than one type argument #1894

@ctron

Description

@ctron

Problem

Using more than one type argument in a component results in the follow error message during compilation:

error: expected a valid html element
  --> src/components/tabs.1.example:10:5
   |
10 |     </TabsRouter<crate::AppRoute, TabRoutes>>
   |     ^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Steps To Reproduce

Create a component with more than one type argument.

Expected behavior

I would expect this to work, like with a single type argument.

Workaround

There is a workaround, you can define a type alias and use this instead:

type MyTabRouter = TabRouter<Foo,Bar>;

And then:

html![
  <MyTabRouter />
}

Environment:

  • Yew version: 0.17, 0.18
  • Rust version: 1.51

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmacroIssues relating to our procedural or declarative macros

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions