1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | var warning = require('fbjs/lib/warning');
|
13 |
|
14 | if (process.env.NODE_ENV !== 'production') {
|
15 | var processingChildContext = false;
|
16 |
|
17 | var warnInvalidSetState = function () {
|
18 | process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
|
19 | };
|
20 | }
|
21 |
|
22 | var ReactInvalidSetStateWarningHook = {
|
23 | onBeginProcessingChildContext: function () {
|
24 | processingChildContext = true;
|
25 | },
|
26 | onEndProcessingChildContext: function () {
|
27 | processingChildContext = false;
|
28 | },
|
29 | onSetState: function () {
|
30 | warnInvalidSetState();
|
31 | }
|
32 | };
|
33 |
|
34 | module.exports = ReactInvalidSetStateWarningHook; |
\ | No newline at end of file |