File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/react-devtools-extensions/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,21 @@ export function createViewElementSource(bridge: Bridge, store: Store) {
12
12
13
13
setTimeout ( ( ) => {
14
14
// Ask Chrome to display the location of the component function,
15
+ // or a render method if it is a Class (ideally Class instance, not type)
15
16
// assuming the renderer found one.
16
17
chrome . devtools . inspectedWindow . eval ( `
17
18
if (window.$type != null) {
18
- inspect(window.$type);
19
+ if (
20
+ window.$type &&
21
+ window.$type.prototype &&
22
+ window.$type.prototype.isReactComponent
23
+ ) {
24
+ // inspect Component.render, not constructor
25
+ inspect(window.$type.prototype.render);
26
+ } else {
27
+ // inspect Functional Component
28
+ inspect(window.$type);
29
+ }
19
30
}
20
31
` ) ;
21
32
} , 100 ) ;
You can’t perform that action at this time.
0 commit comments