question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ouzhenkuncommented, 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

1reaction
developitcommented, May 24, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is componentDidMount not being called when I re-render?
componentDidMount is only called once in the lifecycle of any component, re-render will not reinitialize the component.
Read more >
React.Component
React lets you define components as classes or functions. ... which only fires when the parent causes a re-render and not as a...
Read more >
useEffect(fn, []) is not the new componentDidMount()
Component renders for the first time. The return value of render() is used to mount new DOM. componentDidMount fires and sets state ...
Read more >
componentWillMount() vs componentDidMount()
With React, while a component is rendering it doesn't wait for componentWillMount() to finish, so the component continues to render.
Read more >
React JS componentDidMount() Methods and Functional ...
Render Lifecycle is called first means console of render function is printed. Did mount called (first call after the component is mounted on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found