You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
If a component has a sub-component, under yew 16.0.2, the top-level's render would only be called after the sub-component's view was created and made available to the DOM. That changed with 17.0.
Steps To Reproduce
Steps to reproduce the behavior:
I've created a render_sooner_demo branch that has the following steps in it (in examples/custom_components)
Add log and wasm-logger to Cargo.toml
Add a render method that calls info! to some top-level Component
Add a call to info! in the view method of the sub-component
Run the app and look at the console output
Expected behavior
In yew 16.0.2 (and previous versions that had render), the info! line would be produced after the info! line for any views from any sub-components. Now it's produced before. That means that a top-level render method can't rely on accessing DOM elements that are created by sub-components.
I have never done any React programming, so I don't know if the new behavior should be considered a bug, but it is definitely surprising and has me momentarily not switching to yew 17.0, although I could add some code to make the sub-component send a message up to the parent after its render has been called.
Screenshots
Here's what happens with 17.0:
Here's what happens with 16.2:
Environment:
Yew version: v0.17
Rust version: rustc 1.44.1 (c7087fe00 2020-06-17)
Target, if relevant: whatever examples/build.sh uses
Build tool, if relevant: examples/build.sh
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
I don't know that this is.a bug, but if it is, I'm willing to help
The text was updated successfully, but these errors were encountered:
Problem
If a component has a sub-component, under yew 16.0.2, the top-level's
render
would only be called after the sub-component's view was created and made available to the DOM. That changed with 17.0.Steps To Reproduce
Steps to reproduce the behavior:
log
andwasm-logger
toCargo.toml
render
method that callsinfo!
to some top-level Componentinfo!
in theview
method of the sub-componentExpected behavior
In yew 16.0.2 (and previous versions that had
render
), the info! line would be produced after the info! line for any views from any sub-components. Now it's produced before. That means that a top-levelrender
method can't rely on accessing DOM elements that are created by sub-components.I have never done any React programming, so I don't know if the new behavior should be considered a bug, but it is definitely surprising and has me momentarily not switching to yew 17.0, although I could add some code to make the sub-component send a message up to the parent after its
render
has been called.Screenshots
Here's what happens with 17.0:
Here's what happens with 16.2:
Environment:
v0.17
rustc 1.44.1 (c7087fe00 2020-06-17)
Questionnaire
The text was updated successfully, but these errors were encountered: