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
Since we changed the way definitions are passed down to child Components (with an init function), parsing of subComponent will not happen in constructor but in a call to the init function. Which means that for now, if you want to handle the refs on component instantiation, it should be done in the init or in the ready method instead of constructor. It could be fine like that but it should be explained clearly in the readme. Also maybe we could detect calls to this.refs in constructor and display error messages or something like this (with getter method).
Anyway I think we should either discuss overall lifecycle and find a clear and easy way for the component to be used OR find another way to pass down Definitions while keeping everything in constructor.
The text was updated successfully, but these errors were encountered:
For me, use this.refs in the ready method with a warning if the user try to access this.refs in constructor is fine. It's a pattern used in many libraries and frameworks. People are confortables with this.
Since we changed the way definitions are passed down to child Components (with an init function), parsing of subComponent will not happen in constructor but in a call to the
init
function. Which means that for now, if you want to handle the refs on component instantiation, it should be done in theinit
or in theready
method instead of constructor. It could be fine like that but it should be explained clearly in the readme. Also maybe we could detect calls tothis.refs
in constructor and display error messages or something like this (with getter method).Anyway I think we should either discuss overall lifecycle and find a clear and easy way for the component to be used OR find another way to pass down Definitions while keeping everything in constructor.
The text was updated successfully, but these errors were encountered: