-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deprecation about modifying properties inside the didInsertElement hook to the deprecations guide #12290
Comments
Can you confirm that this is on the list of deprecations pending addition to the deprecations guide? The list is in a large checklist issue in the emberjs/website issues. |
For handling that deprecation, I am currently using this implementation: myMethod: function () {
Ember.run.schedule('afterRender', this, function () {
// some code
});
}.on('init') instead of this: myMethod: function () {
// some code
}.on('didInsertElement') in some cases. |
thanks @furkanayhan! that's the same solution I'm currently using and it definitely removes the deprecation. I'm interested to hear the reasoning behind this deprecation as well as if there are any other "officially" recommended alternatives. |
Added to the list, thanks! |
Issue #11493 mentioned that the following deprecation is not mentioned in the deprecations guide:
DEPRECATION: A property of <Ember.OutletView:ember1021> was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.
I'd just like to request that someone who's knowledgeable about the reasons behind this deprecation add it to the guide (or at least, in the meantime, explain it below).
The text was updated successfully, but these errors were encountered: