yew
yew copied to clipboard
no method named `navigator` found for reference
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
https://yew.rs/docs/concepts/router#struct-components-1
You need to import the extension trait: use yew_router::scope_ext::RouterScopeExt;. I think this should be mentioned more clearly in the documentation.
yew-router = { git = "https://github.com/yewstack/yew.git" } change to yew-router = "0.17.0",no errors.