chore: update react imports

Signed-off-by: Paul Schultz <pschultz@pobox.com>
This commit is contained in:
Paul Schultz
2025-01-28 10:21:17 -06:00
parent 02981a2377
commit 2e26579e06
1282 changed files with 2776 additions and 3434 deletions
@@ -1,4 +1,3 @@
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { {{ pluginVar }}, {{ extensionName }} } from '../src/plugin';
@@ -1,4 +1,3 @@
import React from 'react';
import { ExampleComponent } from './ExampleComponent';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
@@ -1,4 +1,3 @@
import React from 'react';
import { Typography, Grid } from '@material-ui/core';
import {
InfoCard,
@@ -1,4 +1,3 @@
import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
import { ExampleFetchComponent } from './ExampleFetchComponent';
@@ -1,4 +1,3 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import {
Table,
@@ -1,18 +1,17 @@
import React from 'react';
import { screen } from '@testing-library/react';
import { renderInTestApp } from '@backstage/test-utils';
import { ExampleComponent } from './ExampleComponent';
describe('ExampleComponent', () => {
it('should render', async () => {
await renderInTestApp(<ExampleComponent />);
expect(screen.getByText('Hello World')).toBeInTheDocument();
});
it('should display a custom message', async () => {
await renderInTestApp(<ExampleComponent message="Hello Example" />);
expect(screen.getByText('Hello Example')).toBeInTheDocument();
});
});
import { screen } from '@testing-library/react';
import { renderInTestApp } from '@backstage/test-utils';
import { ExampleComponent } from './ExampleComponent';
describe('ExampleComponent', () => {
it('should render', async () => {
await renderInTestApp(<ExampleComponent />);
expect(screen.getByText('Hello World')).toBeInTheDocument();
});
it('should display a custom message', async () => {
await renderInTestApp(<ExampleComponent message="Hello Example" />);
expect(screen.getByText('Hello Example')).toBeInTheDocument();
});
});
@@ -1,29 +1,28 @@
import React from 'react';
import { Typography } from '@material-ui/core';
/**
* Props for {@link ExampleComponent}.
*
* @public
*/
export interface ExampleComponentProps {
message?: string;
}
/**
* Displays an example.
*
* @remarks
*
* Longer descriptions should be put after the `@remarks` tag. That way the initial summary
* will show up in the API docs overview section, while the longer description will only be
* displayed on the page for the specific API.
*
* @public
*/
export function ExampleComponent(props: ExampleComponentProps) {
// By destructuring props here rather than in the signature the API docs will look nicer
const { message = 'Hello World' } = props;
return <Typography variant="h1">{message}</Typography>;
}
import { Typography } from '@material-ui/core';
/**
* Props for {@link ExampleComponent}.
*
* @public
*/
export interface ExampleComponentProps {
message?: string;
}
/**
* Displays an example.
*
* @remarks
*
* Longer descriptions should be put after the `@remarks` tag. That way the initial summary
* will show up in the API docs overview section, while the longer description will only be
* displayed on the page for the specific API.
*
* @public
*/
export function ExampleComponent(props: ExampleComponentProps) {
// By destructuring props here rather than in the signature the API docs will look nicer
const { message = 'Hello World' } = props;
return <Typography variant="h1">{message}</Typography>;
}