yew icon indicating copy to clipboard operation
yew copied to clipboard

no method named `navigator` found for reference

Open jasper2007111 opened this issue 4 years ago • 3 comments

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 avatar Nov 29 '22 08:11 jasper2007111

https://yew.rs/docs/concepts/router#struct-components-1

jasper2007111 avatar Nov 29 '22 08:11 jasper2007111

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 avatar Nov 29 '22 19:11 WorldSEnder

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

jasper2007111 avatar Nov 30 '22 01:11 jasper2007111