File tree Expand file tree Collapse file tree 3 files changed +7
-22
lines changed
plugins/backstage-plugin-coder/src/components/CoderErrorBoundary Expand file tree Collapse file tree 3 files changed +7
-22
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,6 @@ const app = createApp({
79
79
} ,
80
80
} ) ;
81
81
82
- /**
83
- * 2024-02-13 - The version of TechDocsAddons that Backstage ships with makes
84
- * the TypeScript compiler complain when you try to render it as JSX. This seems
85
- * like it's just a type mismatch issue, and things still work at runtime
86
- */
87
- const FixedTechDocsAddons = TechDocsAddons as React . FC < unknown > ;
88
-
89
82
const routes = (
90
83
< FlatRoutes >
91
84
< Route path = "/" element = { < Navigate to = "catalog" /> } />
@@ -101,9 +94,9 @@ const routes = (
101
94
path = "/docs/:namespace/:kind/:name/*"
102
95
element = { < TechDocsReaderPage /> }
103
96
>
104
- < FixedTechDocsAddons >
97
+ < TechDocsAddons >
105
98
< ReportIssue />
106
- </ FixedTechDocsAddons >
99
+ </ TechDocsAddons >
107
100
</ Route >
108
101
< Route path = "/create" element = { < ScaffolderPage /> } />
109
102
< Route path = "/api-docs" element = { < ApiExplorerPage /> } />
Original file line number Diff line number Diff line change @@ -60,18 +60,11 @@ import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
60
60
61
61
import { CoderWorkspacesCard } from '@coder/backstage-plugin-coder' ;
62
62
63
- /**
64
- * 2024-02-13 - The version of TechDocsAddons that Backstage ships with makes
65
- * the TypeScript compiler complain when you try to render it as JSX. This seems
66
- * like it's just a type mismatch issue, and things still work at runtime
67
- */
68
- const FixedTechDocsAddons = TechDocsAddons as React . FC < unknown > ;
69
-
70
63
const techdocsContent = (
71
64
< EntityTechdocsContent >
72
- < FixedTechDocsAddons >
65
+ < TechDocsAddons >
73
66
< ReportIssue />
74
- </ FixedTechDocsAddons >
67
+ </ TechDocsAddons >
75
68
</ EntityTechdocsContent >
76
69
) ;
77
70
Original file line number Diff line number Diff line change 1
1
import React , {
2
2
type ErrorInfo ,
3
- type FC ,
4
3
type ReactNode ,
5
4
Component ,
6
5
} from 'react' ;
@@ -39,7 +38,7 @@ class ErrorBoundaryCore extends Component<
39
38
}
40
39
41
40
componentDidCatch ( error : Error , errorInfo : ErrorInfo ) : void {
42
- this . props . onError ( error , errorInfo . componentStack ) ;
41
+ this . props . onError ( error , errorInfo . componentStack || "no details" ) ;
43
42
}
44
43
45
44
render ( ) {
@@ -53,10 +52,10 @@ type CoderErrorBoundaryProps = {
53
52
fallbackUi ?: ReactNode ;
54
53
} ;
55
54
56
- export const CoderErrorBoundary : FC < CoderErrorBoundaryProps > = ( {
55
+ export const CoderErrorBoundary = ( {
57
56
children,
58
57
fallbackUi,
59
- } ) => {
58
+ } : CoderErrorBoundaryProps ) => {
60
59
const errorApi = useApi ( errorApiRef ) ;
61
60
const fallbackContent = fallbackUi ?? < FallbackUi /> ;
62
61
You can’t perform that action at this time.
0 commit comments