Skip to content

Borrowing from self in routes #1102

@Boscop

Description

@Boscop

I was reading the yew-router guide yesterday, which has this code: https://github.com/yewstack/yew_router/blob/master/examples/guide/chapters/02_router_component.md#example

html! {
    <Router>
        <Route matcher=route!("/b")> 
            <BModel/>
        </Route>
...

Presumably, state passed as attributes to BModel could borrow from self at the time the guide was written (like <BModel foo=&self.bar />). But this example (and others from the guide) don't compile anymore..

I'd really like to have this back, because currently it's very inconvenient.
Also with functions mapped over iterators that should be rendered (like
{ for self.foos.iter().map(render_foo) }), currently they can't borrow from self anymore either..

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions