Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 747 Bytes

09-componentWillReceiveProps-not-triggered-after-mounting.md

File metadata and controls

12 lines (10 loc) · 747 Bytes
id title layout permalink prev next
componentWillReceiveProps-not-triggered-after-mounting
componentWillReceiveProps Not Triggered After Mounting
tips
componentWillReceiveProps-not-triggered-after-mounting.html
controlled-input-null-value.html
props-in-getInitialState-as-anti-pattern.html

componentWillReceiveProps isn't triggered after the node is put on scene. This is by design. Check out other lifecycle methods for the one that suits your needs.

The reason for that is because componentWillReceiveProps often handles the logic of comparing with the old props and acting upon changes; not triggering it at mounting (where there are no old props) helps in defining what the method does.