Skip to content

Commit fe77ee9

Browse files
Added component stack to ReactFiber
Updated unit tests to expect component stack as well
1 parent 69fcc81 commit fe77ee9

File tree

2 files changed

+1217
-1
lines changed

2 files changed

+1217
-1
lines changed

packages/react-reconciler/src/ReactFiber.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ var {NoEffect} = require('ReactTypeOfSideEffect');
4343

4444
var invariant = require('fbjs/lib/invariant');
4545

46+
import ReactDebugCurrentFiber from './ReactDebugCurrentFiber';
47+
48+
var {getCurrentFiberStackAddendum} = ReactDebugCurrentFiber;
49+
4650
if (__DEV__) {
4751
var getComponentName = require('getComponentName');
4852
var hasBadMapPolyfill = false;
@@ -393,9 +397,10 @@ function createFiberFromElementType(
393397
invariant(
394398
false,
395399
'Element type is invalid: expected a string (for built-in components) ' +
396-
'or a class/function (for composite components) but got: %s.%s',
400+
'or a class/function (for composite components) but got: %s.%s%s',
397401
type == null ? type : typeof type,
398402
info,
403+
getCurrentFiberStackAddendum() || '',
399404
);
400405
}
401406
return fiber;

0 commit comments

Comments
 (0)