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

3.6.3 isMounted returns false inside .on("mount") event #2436

Closed
pmmf85 opened this Issue Aug 31, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@pmmf85

pmmf85 commented Aug 31, 2017

  1. Describe your issue:
    In child tag, inside "mount" event, value of this.isMounted returns false and there are no refs in this.refs object is specific case, despite there should be (example below).
    It looks like that riot is trying to trigger "mount" event on tags that weren't fully mounted and shouldn't be mounted anymore.
    It was not present in 3.6.1. Upgrading to 3.6.3 triggers this error for me.

  2. Can you reproduce the issue?
    http://plnkr.co/edit/3aTuWEd6vCFPVbZNCMqs?p=preview

  3. On which browser/OS does the issue appear?
    Chrome 59.0.3071.115, macOS, Sierra

  4. Which version of Riot does it affect?
    Riot 3.6.3

  5. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance

GianlucaGuarini added a commit that referenced this issue Sep 2, 2017

GianlucaGuarini added a commit that referenced this issue Sep 2, 2017

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Sep 2, 2017

Member

Despite the errors thrown (not due to riot) by the example linked above, I wouldn't recommend to wildly mounting/unmounting your components during the mounting event itself. What's linked above is an example of race condition and it's a symptom of bad programming that in other languages would throw a Memory Exception error.
Now I have added a patch to solve the problem thank you for reporting it anyway.

Member

GianlucaGuarini commented Sep 2, 2017

Despite the errors thrown (not due to riot) by the example linked above, I wouldn't recommend to wildly mounting/unmounting your components during the mounting event itself. What's linked above is an example of race condition and it's a symptom of bad programming that in other languages would throw a Memory Exception error.
Now I have added a patch to solve the problem thank you for reporting it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment