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

InnerMost Component isn't firing 'WillMount', 'DidMount' when re-render #143

Closed
ouzhenkun opened this issue May 10, 2016 · 9 comments
Closed

Comments

@ouzhenkun
Copy link
Contributor

ouzhenkun commented May 10, 2016

in my case:

App:
  <div><Panel /></div>

Panel:
  <div><Title /></div>

render(<App/>, document.body)

when the <Panel/> re-render, the <Title/> isn't firing 'WillMount', 'DidMount' etc.

codepen: http://codepen.io/ryan_ou/pen/QNYegz?editors=0011

@ouzhenkun ouzhenkun changed the title InnerMost Component isn't firing 'WillMount, DidMount when re-render InnerMost Component isn't firing 'WillMount', 'DidMount' when re-render May 10, 2016
@developit
Copy link
Member

developit commented May 10, 2016

@zhenkunou Looks like this is part of the regression in 4.6.2 (reverting to 4.6.0 fixes your codepen example), currently my top priority. I'll keep you posted as I progress, thanks for the demo!

@developit
Copy link
Member

Fix is on the way! :)

@ouzhenkun
Copy link
Contributor Author

Awesome!

@developit
Copy link
Member

@zhenkunou I've released this under the beta tag: npm i -S preact@beta

@developit
Copy link
Member

Marking this as closed since both of our tests pass. I'll make an announcement when it's rolled out of beta :)

@developit
Copy link
Member

Note: confirmed fix verification http://codepen.io/developit/pen/reXZvd?editors=0010

@ouzhenkun
Copy link
Contributor Author

Great work, Thanks!!!
Everything is fine, only one issue i found today, pls take a look. issue: #162

@ouzhenkun
Copy link
Contributor Author

ouzhenkun commented May 30, 2016

@developit it seem that the bug is still here:

OuterComponent
  div
     Inner1Component
        div
          Inner2Component
            div
              Inner3Component
...

render(<OuterComponent />, document.body)

The Inner3 Component 'DidMount' not being called when re-render.

http://codepen.io/ryan_ou/pen/QNYegz?editors=0011
codepen changelog:
upgrade to preact@beta
add more inner component

@developit
Copy link
Member

developit commented May 30, 2016

@zhenkunou Yikes! Sorry about that - I've got a fix coming. The original fix missed a code path for remounting nested trees of components.

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

No branches or pull requests

2 participants