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:
- I combine the examples here in this repository (ignore the Bazel stuff, that's additional work)
trunk build index.htmlcargo run --features=ssr --bin simple_ssr_server -- --dir dist/- Navigate to
localhost:8081– see nav + random uuid rendered - Click the "Hi" link – see nav + "Hi" rendered
- Use the back button, or click the "Home" link – see only nav rendered
- 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:
After clicking "hi" link:
Clicking "home" or via browser back button:

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
Source: yewstack/yew