set PropsWithChildren as explicit type on components

Signed-off-by: Oleg S <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
Oleg S
2023-05-05 13:26:58 -04:00
committed by Fredrik Adelöw
parent 38d8ad9373
commit 74b216ee4e
64 changed files with 149 additions and 110 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import { ComponentType } from 'react';
import { Entity } from '@backstage/catalog-model';
import { GridProps } from '@material-ui/core';
import { IconComponent } from '@backstage/core-plugin-api';
import { PropsWithChildren } from 'react';
import { ReactNode } from 'react';
// @public
@@ -22,7 +23,7 @@ export class DevAppBuilder {
addPage(opts: DevAppPageOptions): DevAppBuilder;
addRootChild(node: ReactNode): DevAppBuilder;
addThemes(themes: AppTheme[]): this;
build(): ComponentType<{}>;
build(): ComponentType<PropsWithChildren<{}>>;
registerApi<
Api,
Impl extends Api,
+2 -2
View File
@@ -44,7 +44,7 @@ import {
} from '@backstage/integration-react';
import { Box } from '@material-ui/core';
import BookmarkIcon from '@material-ui/icons/Bookmark';
import React, { ComponentType, ReactNode } from 'react';
import React, { ComponentType, ReactNode, PropsWithChildren } from 'react';
import ReactDOM from 'react-dom';
import { createRoutesFromChildren, Route } from 'react-router-dom';
import { SidebarThemeSwitcher } from './SidebarThemeSwitcher';
@@ -164,7 +164,7 @@ export class DevAppBuilder {
/**
* Build a DevApp component using the resources registered so far
*/
build(): ComponentType<{}> {
build(): ComponentType<PropsWithChildren<{}>> {
const fakeRouteRef = createRouteRef({ id: 'fake' });
const FakePage = () => <Box p={3}>Page belonging to another plugin.</Box>;
attachComponentData(FakePage, 'core.mountPoint', fakeRouteRef);