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

no method named navigator found for reference #2987

Closed
jasper2007111 opened this issue Nov 29, 2022 · 3 comments
Closed

no method named navigator found for reference #2987

jasper2007111 opened this issue Nov 29, 2022 · 3 comments
Labels
A-yew-router Area: The yew-router crate documentation

Comments

@jasper2007111
Copy link

fn view(&self, ctx: &Context<Self>) -> Html {
        let history = ctx.link().navigator().unwrap();
        let onclick = Callback::from(move |_| history.push(Route::Add));

no method named navigator found for reference

@jasper2007111
Copy link
Author

@WorldSEnder
Copy link
Member

You need to import the extension trait: use yew_router::scope_ext::RouterScopeExt;. I think this should be mentioned more clearly in the documentation.

@WorldSEnder WorldSEnder added documentation A-yew-router Area: The yew-router crate and removed bug labels Nov 29, 2022
@jasper2007111
Copy link
Author

yew-router = { git = "https://github.com/yewstack/yew.git" }
change to yew-router = "0.17.0",no errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew-router Area: The yew-router crate documentation
Projects
None yet
Development

No branches or pull requests

2 participants