Skip to content
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

Nesting self-updating components. #263

Closed
dxlbnl opened this issue Jan 24, 2017 · 2 comments
Closed

Nesting self-updating components. #263

dxlbnl opened this issue Jan 24, 2017 · 2 comments
Labels

Comments

@dxlbnl
Copy link
Contributor

dxlbnl commented Jan 24, 2017

I've come across an issue, where onrender of a component isn't always called when it is being mounted.

I've created an example here.
It's got 3 components: Root -> List -> Item
List is being updated asynchronously. and it's adding some items to it's data.
The initial set of Items, from list is being rendered correctly. But the new elements rendered by the other values, are not being updated.

The problem lies in this generated code:

  if ( options._root ) {
    options._root._renderHooks.push({ fn: template$2.onrender, context: this });
  } else {
    template$2.onrender.call( this );
  }

options._root is the Root element. But that element is never updated, so it's _renderHooks are never called.
I can verify this by calling .set({}) on the root element.

@dxlbnl
Copy link
Contributor Author

dxlbnl commented Jan 24, 2017

I can try to fix it. But I'm not familiar with the internals. Any pointers where the issue lies?

@Rich-Harris
Copy link
Member

Released 1.6.8 with the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants