-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Using with mut
results in render error
#11
Comments
@tstormk - Hmm, seems somewhat surprising. Can you submit a failing test to this repo (it would make it a bit easier to dig into)? I think a rendering test would reproduce right? |
@rwjblue Any news on this? |
@rwjblue hi. Can you please look at this issue again? It still happens in 3.18. |
it looks like it's rather |
Hi, I'm seeing this error with Ember 3.25. any ideas to get around this issue? Thanks |
Hello!
Say I have a component
Test
:components/test/template.hbs
<div {{did-insert (fn (mut this.element))}} {{will-destroy (fn (mut this.element) null)}} />
When that component is destroyed, it results in the following error:
You modified "element" twice on [object Object] in a single render. It was rendered in undefined and modified in undefined. [...]
If I instead perform the registering/unregistering like so:
components/test/template.hbs
<div {{did-insert this.register}} {{will-destroy this.unregister}} />
components/test/component.js
Destroying the component doesn't result in an error.
This happens when
mut
-ing any property with any value on destroy, by the way, not just an element or a property that has been set before.For reference, here's the code I used to test it:
Also, I'm not sure it makes any difference, but I'm on a canary build of Ember:
"ember-source": "https://s3.amazonaws.com/builds.emberjs.com/canary/shas/55f876ebc10bd1645e1e62fc5e0408266952259b.tgz"
"ember-cli": "github:ember-cli/ember-cli#ba9e3ea9bcad1c6e2299e40fe265cffe61d7a25b"
Any help would be appreciated!
UPDATE: It works if I use the
action
helper instead offn
. It also passes if I useember-fn-helper-polyfill
for fn. If I use the Ember 3.11 version offn
however, it fails with the error specified above.The text was updated successfully, but these errors were encountered: