fix techdocs-cli embedded app

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Eric Peterson <ericpeterson@spotify.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-04-01 14:40:00 +02:00
parent 914cfdb0b7
commit c969da2fcd
3 changed files with 15 additions and 12 deletions
@@ -83,16 +83,17 @@ export type TechDocsReaderPageProps = {
*/
export const TechDocsReaderPage = ({
entityRef,
children,
children
}: TechDocsReaderPageProps) => {
const { kind, name, namespace } = useParams();
const route = useOutlet() || { props: { children: [] } };
const outlet = useOutlet()
const entityName = entityRef ?? { kind, name, namespace };
if (!children) {
const outlet = Children.toArray(route.props.children);
const childrenList = outlet ? Children.toArray(outlet.props.children) : [];
const page = outlet.find(child => {
const page = childrenList.find(child => {
const { type } = child as Extension;
return !type?.__backstage_data?.map?.get(TECHDOCS_ADDONS_WRAPPER_KEY);
});