#3023·yew

Server-side data fetching not re-rendering

Author: snapbugCreated Dec 10, 2022Updated Apr 8, 2026

Problem Merging the server-side rendering+data-fetching example, and the server-side routing example results in empty renders when navigating back to the component that uses server-side fetching.

It's entirely possible I've made a mistake in transcribing the examples, but I can't

Steps To Reproduce Steps to reproduce the behavior:

  1. I combine the examples here in this repository (ignore the Bazel stuff, that's additional work)
  2. trunk build index.html
  3. cargo run --features=ssr --bin simple_ssr_server -- --dir dist/
  4. Navigate to localhost:8081 – see nav + random uuid rendered
  5. Click the "Hi" link – see nav + "Hi" rendered
  6. Use the back button, or click the "Home" link – see only nav rendered
  7. Reload the root page - see nav + random uuid rendered

Expected behavior Either cached value from the first render, or re-render with a new random uuid

Screenshots Initial load: Screenshot 2022-12-09 at 19 44 54 After clicking "hi" link: Screenshot 2022-12-09 at 19 45 01 Clicking "home" or via browser back button: Screenshot 2022-12-09 at 19 45 07

Environment:

  • Yew version: yew: 0.20.0 yew-router: 0.17.0
  • Rust version: 1.64.0
  • Browser and version, if relevant: Safari 16.1 & Chrome 107.0.5304.121

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