yewstack/yew

A question about using async.

ZhangXiChang opened this issue ยท 0 comments

Problem

"https://github.com/ZhangXiChang/webapp/blob/master/frontend/src/main.rs"

This is the link to my code.๐Ÿ‘†

I want to know how to render the results requested from the server to the web page in real time?
In my code I request the title string from the server and store the result in a variable and then use it in the html. However, when the web page is rendered, the web page is rendered before the result is requested, causing the title variable string to be empty. After requesting the results, the web page has been rendered.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Update web content in real time.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • Yew version: 0.21.0
  • Rust version: 1.72.1
  • Target, if relevant: wasm32-unknown-unknown
  • Build tool, if relevant: trunk
  • OS, if relevant: Windows
  • Browser and version, if relevant: Microsoft Edge ็‰ˆๆœฌ 117.0.2045.60

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