Problems using yew and bevy together #3415
ZhangXiChang
started this conversation in
General
Replies: 2 comments
-
Is there a way to make bevy run after yew rendering is complete? |
Beta Was this translation helpful? Give feedback.
0 replies
-
in your main component you can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
I use yew to render the web page, and then let bevy look for the canvas tag created by yew to draw, but bevy cannot find the canvas tag created by yew. If I write the canvas tag directly in the index.html file instead of yew, bevy can find the canvas tag and draw it
I'm wondering if it's because yew and bevy start running in the same frame, and yew looks for a non-existent canvas tag before bevy has finished rendering, causing this problem?
Steps To Reproduce
Steps to reproduce the behavior:
1.write the code
2.Execute "trunk serve" to run
3.Browser console error: panicked at 'Cannot find element: #bevy.
Expected behavior
bevy draws graphics in the canvas tag created by yew
Screenshots
Problem code repository:
https://github.com/ZhangXiChang/webapp
Environment:
Questionnaire
Beta Was this translation helpful? Give feedback.
All reactions