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.

componentWillMount not triggering under certain scenarios

See original GitHub issue

Hi, I’m using preact-router along with react-redux. As @developit pointed, this check is the problem https://github.com/developit/preact/blob/master/src/vdom/component.js#L131

Removing the if did the trick and triggered componentWillMount. This is my scenario https://github.com/impronunciable/hackdash-front/blob/master/src/containers/Dashboard.js#L8

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
developitcommented, Apr 19, 2016

Alright, I’ll get some tests around this. Going to need to queue some lifecycle events, there are 3 open issues relating to their timing now.

0reactions
developitcommented, May 24, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

componentWillMount is deprecated and will be removed in the ...
It is called before render(), therefore calling setState() synchronously in this method will not trigger an extra rendering.
Read more >
`componentWillReceiveProps()` does not trigger for new ...
The componentWillReceiveProps() method only triggers if props change. However, there are situations where the context changes, but the props ...
Read more >
React.Component
UNSAFE_componentWillMount() is invoked just before mounting occurs. It is called before render() , therefore calling setState() synchronously in this method ...
Read more >
React componentWillMount() | Working and Example with ...
Guide to React componentWillMount(). Here we discuss the introduction, syntax, and working along with examples and advantages.
Read more >
How to Use componentWillMount in React - Pluralsight
As you know, the life-cycle hook componentWillMount triggers before the initial render, and the function will only trigger once in the ...
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