diff --git a/.changeset/healthy-shoes-flash.md b/.changeset/healthy-shoes-flash.md new file mode 100644 index 0000000000..5e255020da --- /dev/null +++ b/.changeset/healthy-shoes-flash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Changed to use from createApp diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index aae88d406e..d96bed6b60 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -19,11 +19,10 @@ import { useOutlet } from 'react-router'; import { useParams } from 'react-router-dom'; import useAsync from 'react-use/lib/useAsync'; import { techdocsApiRef } from '../../api'; -import { TechDocsNotFound } from './TechDocsNotFound'; import { LegacyTechDocsPage } from './LegacyTechDocsPage'; import { TechDocsEntityMetadata, TechDocsMetadata } from '../../types'; import { EntityName } from '@backstage/catalog-model'; -import { useApi } from '@backstage/core-plugin-api'; +import { useApi, useApp } from '@backstage/core-plugin-api'; import { Page } from '@backstage/core-components'; export type TechDocsPageRenderFunction = ({ @@ -42,6 +41,7 @@ export type TechDocsPageProps = { }; export const TechDocsPage = ({ children }: TechDocsPageProps) => { + const { NotFoundErrorPage } = useApp().getComponents(); const outlet = useOutlet(); const [documentReady, setDocumentReady] = useState(false); @@ -66,9 +66,7 @@ export const TechDocsPage = ({ children }: TechDocsPageProps) => { setDocumentReady(true); }, [setDocumentReady]); - if (entityMetadataError) { - return ; - } + if (entityMetadataError) return ; if (!children) return outlet || ;