set PropsWithChildren as explicit type on components
Signed-off-by: Oleg S <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user