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.
35 lines
1.2 KiB
35 lines
1.2 KiB
/** |
|
* Copyright 2015, Facebook, Inc. |
|
* All rights reserved. |
|
* |
|
* This source code is licensed under the BSD-style license found in the |
|
* LICENSE file in the root directory of this source tree. An additional grant |
|
* of patent rights can be found in the PATENTS file in the same directory. |
|
* |
|
* @providesModule ReactLifeCycle |
|
*/ |
|
|
|
'use strict'; |
|
|
|
/** |
|
* This module manages the bookkeeping when a component is in the process |
|
* of being mounted or being unmounted. This is used as a way to enforce |
|
* invariants (or warnings) when it is not recommended to call |
|
* setState/forceUpdate. |
|
* |
|
* currentlyMountingInstance: During the construction phase, it is not possible |
|
* to trigger an update since the instance is not fully mounted yet. However, we |
|
* currently allow this as a convenience for mutating the initial state. |
|
* |
|
* currentlyUnmountingInstance: During the unmounting phase, the instance is |
|
* still mounted and can therefore schedule an update. However, this is not |
|
* recommended and probably an error since it's about to be unmounted. |
|
* Therefore we still want to trigger in an error for that case. |
|
*/ |
|
|
|
var ReactLifeCycle = { |
|
currentlyMountingInstance: null, |
|
currentlyUnmountingInstance: null |
|
}; |
|
|
|
module.exports = ReactLifeCycle;
|
|
|