You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
752 B
13 lines
752 B
11 years ago
|
---
|
||
|
id: componentWillReceiveProps-not-triggered-after-mounting
|
||
11 years ago
|
title: componentWillReceiveProps Not Triggered After Mounting
|
||
11 years ago
|
layout: tips
|
||
11 years ago
|
permalink: componentWillReceiveProps-not-triggered-after-mounting.html
|
||
11 years ago
|
prev: controlled-input-null-value.html
|
||
11 years ago
|
next: props-in-getInitialState-as-anti-pattern.html
|
||
11 years ago
|
---
|
||
|
|
||
11 years ago
|
`componentWillReceiveProps` isn't triggered after the node is put on scene. This is by design. Check out [other lifecycle methods](/react/docs/tips/component-specs.html) for the one that suits your needs.
|
||
11 years ago
|
|
||
11 years ago
|
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.
|