@@ -18,7 +18,8 @@ import {
1818 getIsWaitingOnBreak ,
1919 getShouldPauseOnExceptions ,
2020 getShouldIgnoreCaughtExceptions ,
21- getWorkers
21+ getWorkers ,
22+ getExtra
2223} from "../../selectors" ;
2324
2425import Svg from "../shared/Svg" ;
@@ -34,6 +35,7 @@ import Accordion from "../shared/Accordion";
3435import CommandBar from "./CommandBar" ;
3536import UtilsBar from "./UtilsBar" ;
3637import renderBreakpointsDropdown from "./BreakpointsDropdown" ;
38+ import FrameworkComponent from "./FrameworkComponent" ;
3739
3840import _chromeScopes from "./ChromeScopes" ;
3941import _Scopes from "./Scopes" ;
@@ -67,6 +69,7 @@ function debugBtn(onClick, type, className, tooltip) {
6769}
6870
6971type Props = {
72+ extra : Object ,
7073 evaluateExpressions : Function ,
7174 hasFrames : boolean ,
7275 horizontal : boolean ,
@@ -151,6 +154,20 @@ class SecondaryPanes extends Component<Props> {
151154 } ;
152155 }
153156
157+ getComponentItem ( ) {
158+ const { extra : { react } } = this . props ;
159+
160+ return {
161+ header : react . displayName ,
162+ className : "component-pane" ,
163+ component : < FrameworkComponent /> ,
164+ opened : prefs . componentVisible ,
165+ onToggle : opened => {
166+ prefs . componentVisible = opened ;
167+ }
168+ } ;
169+ }
170+
154171 getWatchItem ( ) : AccordionPaneItem {
155172 return {
156173 header : L10N . getStr ( "watchExpressions.header" ) ,
@@ -224,7 +241,7 @@ class SecondaryPanes extends Component<Props> {
224241 }
225242
226243 getStartItems ( ) {
227- const { workers } = this . props ;
244+ const { extra , workers } = this . props ;
228245
229246 const items : Array < AccordionPaneItem > = [ ] ;
230247 if ( this . props . horizontal ) {
@@ -239,7 +256,12 @@ class SecondaryPanes extends Component<Props> {
239256
240257 if ( this . props . hasFrames ) {
241258 items . push ( this . getCallStackItem ( ) ) ;
259+
242260 if ( this . props . horizontal ) {
261+ if ( extra && extra . react ) {
262+ items . push ( this . getComponentItem ( ) ) ;
263+ }
264+
243265 items . push ( this . getScopeItem ( ) ) ;
244266 }
245267 }
@@ -260,7 +282,7 @@ class SecondaryPanes extends Component<Props> {
260282 }
261283
262284 getEndItems ( ) {
263- const { workers } = this . props ;
285+ const { extra , workers } = this . props ;
264286
265287 let items : Array < AccordionPaneItem > = [ ] ;
266288
@@ -274,6 +296,10 @@ class SecondaryPanes extends Component<Props> {
274296
275297 items . push ( this . getWatchItem ( ) ) ;
276298
299+ if ( extra && extra . react ) {
300+ items . push ( this . getComponentItem ( ) ) ;
301+ }
302+
277303 if ( this . props . hasFrames ) {
278304 items = [ ...items , this . getScopeItem ( ) ] ;
279305 }
@@ -332,6 +358,7 @@ SecondaryPanes.contextTypes = {
332358
333359export default connect (
334360 state => ( {
361+ extra : getExtra ( state ) ,
335362 hasFrames : ! ! getTopFrame ( state ) ,
336363 breakpoints : getBreakpoints ( state ) ,
337364 breakpointsDisabled : getBreakpointsDisabled ( state ) ,
0 commit comments