Skip to content

Commit 543f487

Browse files
committed
Start monitoring uses of withContext, related to issue facebook#2112
1 parent c10a39e commit 543f487

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/ReactContext.js

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"use strict";
1313

1414
var assign = require('Object.assign');
15+
var monitorCodeUse = require('monitorCodeUse');
1516

1617
/**
1718
* Keeps track of the current context.
@@ -28,6 +29,9 @@ var ReactContext = {
2829
current: {},
2930

3031
/**
32+
*
33+
* @deprecated
34+
*
3135
* Temporarily extends the current context while executing scopedCallback.
3236
*
3337
* A typical use case might look like
@@ -44,6 +48,11 @@ var ReactContext = {
4448
* @return {ReactComponent|array<ReactComponent>}
4549
*/
4650
withContext: function(newContext, scopedCallback) {
51+
52+
monitorCodeUse('react_with_context',
53+
{newContext: newContext, scopedCallback: scopedCallback}
54+
);
55+
4756
var result;
4857
var previousContext = ReactContext.current;
4958
ReactContext.current = assign({}, previousContext, newContext);

0 commit comments

Comments
 (0)