Skip to content

Handler Id Warning #870

@tarkah

Description

@tarkah

Problem
I'm getting the following warning when switching between different routes using yew_router. I have 5 different components that I switch between when route changes using Router::render. One of the components has a table with 100 rows, this warning returns ~100 times when I switch off that route. Whereas one route is just an index page with static text, and it returns the warning 4 times when switched off that route.

WARN:yew::agent -- The Id of the handler: 0, while present in the slab, is not associated with a callback.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Use yew_router
  2. Use Router::render to render different components, ex: below

There is nothing special about these components. IndexPage for example just renders static text in a <p> tag, yet still produces the above warning 4 times when route changes and different component is then rendered.

html! {
	<Router<AppRoute, ()>
		render = Router::render(move |switch: AppRoute| {
			match switch {
				AppRoute::Index => html!{<IndexPage />},
				AppRoute::Songs => html! {<SongsPage />},
				AppRoute::Artist(id) => html!{<ArtistPage artist_id=id />},
				AppRoute::Artists => html!{<ArtistsPage />},
				AppRoute::Queue => html!{<QueuePage />},
				AppRoute::NotFound(Permissive(None)) => html!{"Page not found"},
				AppRoute::NotFound(Permissive(Some(missed_route))) => html!{format!("Page '{}' not found", missed_route)},
				_ => html!{"Page not found"},
			}
		})
		redirect = Router::redirect(|route: Route| {
			AppRoute::NotFound(Permissive(Some(route.route)))
		})
	/>
}

Environment:

  • Yew version v0.11
  • Yew-router version v0.8.1
  • Rust version 1.40.0
  • Target wasm32-unknown-unknown
  • stdweb version
  • OS: linux
  • Browser: firefox
  • Browser version 72.0.1

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions