Skip to content

Commit

Permalink
Fix yarn tsc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
code-asher committed Feb 24, 2024
1 parent deac4f3 commit 7954baf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
11 changes: 2 additions & 9 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ const app = createApp({
},
});

/**
* 2024-02-13 - The version of TechDocsAddons that Backstage ships with makes
* the TypeScript compiler complain when you try to render it as JSX. This seems
* like it's just a type mismatch issue, and things still work at runtime
*/
const FixedTechDocsAddons = TechDocsAddons as React.FC<unknown>;

const routes = (
<FlatRoutes>
<Route path="/" element={<Navigate to="catalog" />} />
Expand All @@ -101,9 +94,9 @@ const routes = (
path="/docs/:namespace/:kind/:name/*"
element={<TechDocsReaderPage />}
>
<FixedTechDocsAddons>
<TechDocsAddons>
<ReportIssue />
</FixedTechDocsAddons>
</TechDocsAddons>
</Route>
<Route path="/create" element={<ScaffolderPage />} />
<Route path="/api-docs" element={<ApiExplorerPage />} />
Expand Down
11 changes: 2 additions & 9 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,11 @@ import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';

import { CoderWorkspacesCard } from '@coder/backstage-plugin-coder';

/**
* 2024-02-13 - The version of TechDocsAddons that Backstage ships with makes
* the TypeScript compiler complain when you try to render it as JSX. This seems
* like it's just a type mismatch issue, and things still work at runtime
*/
const FixedTechDocsAddons = TechDocsAddons as React.FC<unknown>;

const techdocsContent = (
<EntityTechdocsContent>
<FixedTechDocsAddons>
<TechDocsAddons>
<ReportIssue />
</FixedTechDocsAddons>
</TechDocsAddons>
</EntityTechdocsContent>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {
type ErrorInfo,
type FC,
type ReactNode,
Component,
} from 'react';
Expand Down Expand Up @@ -39,7 +38,7 @@ class ErrorBoundaryCore extends Component<
}

componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
this.props.onError(error, errorInfo.componentStack);
this.props.onError(error, errorInfo.componentStack || "no details");
}

render() {
Expand All @@ -53,10 +52,10 @@ type CoderErrorBoundaryProps = {
fallbackUi?: ReactNode;
};

export const CoderErrorBoundary: FC<CoderErrorBoundaryProps> = ({
export const CoderErrorBoundary = ({
children,
fallbackUi,
}) => {
}: CoderErrorBoundaryProps) => {
const errorApi = useApi(errorApiRef);
const fallbackContent = fallbackUi ?? <FallbackUi />;

Expand Down

0 comments on commit 7954baf

Please sign in to comment.