componentWillMount not triggering under certain scenarios
See original GitHub issueHi, 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:
- Created 7 years ago
- Reactions:3
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Fix verification: http://codepen.io/developit/pen/reXZvd?editors=0010