File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
packages/react-router-devtools/src/client Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ export const useTabs = () => {
1313
1414 const { Component, hideTimeline } = useMemo ( ( ) => {
1515 const tab = allTabs . find ( ( tab ) => tab . id === activeTab )
16- return { Component : tab ?. component , hideTimeline : shouldHideTimeline ( tab ) }
16+ return {
17+ Component : tab ?. component ,
18+ hideTimeline : shouldHideTimeline ( tab ) ,
19+ }
1720 } , [ activeTab , allTabs ] )
1821
1922 return {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const ContentPanel = () => {
1616 activeTab === "page" && styles . layout . contentPanel . mainContentPageTab
1717 ) }
1818 >
19- { Component }
19+ { Component && < Component /> }
2020 </ div >
2121
2222 { ! hideTimeline && (
Original file line number Diff line number Diff line change 1- import type { JSX } from "react"
1+ import type { ComponentType , JSX } from "react"
22import { Icon } from "../components/icon/Icon.js"
33import { NetworkTab } from "./NetworkTab.js"
44import { PageTab } from "./PageTab.js"
@@ -10,7 +10,7 @@ export interface Tab {
1010 name : string | JSX . Element
1111 icon : JSX . Element
1212 id : string
13- component : JSX . Element
13+ component : ComponentType
1414 hideTimeline : boolean
1515}
1616
@@ -19,21 +19,21 @@ export const tabs = [
1919 name : "Active page" ,
2020 icon : < Icon size = "md" name = "Layers" /> ,
2121 id : "page" ,
22- component : < PageTab /> ,
22+ component : PageTab ,
2323 hideTimeline : false ,
2424 } ,
2525 {
2626 name : "Routes" ,
2727 icon : < Icon size = "md" name = "GitMerge" /> ,
2828 id : "routes" ,
29- component : < RoutesTab /> ,
29+ component : RoutesTab ,
3030 hideTimeline : false ,
3131 } ,
3232 {
3333 name : "Network" ,
3434 icon : < Icon size = "md" name = "Network" /> ,
3535 id : "network" ,
36- component : < NetworkTab /> ,
36+ component : NetworkTab ,
3737
3838 hideTimeline : true ,
3939 } ,
You can’t perform that action at this time.
0 commit comments