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
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import {
PageBlueprint,
createExtensionInput,
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import {
PageBlueprint,
createExtensionInput,
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { SearchResultListItemBlueprint } from './SearchResultListItemBlueprint';
import {
createExtensionTester,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { lazy } from 'react';
import { lazy } from 'react';
import {
createExtensionBlueprint,
ExtensionBoundary,
@@ -21,7 +21,6 @@ import CssBaseline from '@material-ui/core/CssBaseline';
import { ThemeProvider } from '@material-ui/core/styles';
import FindInPageIcon from '@material-ui/icons/FindInPage';
import GroupIcon from '@material-ui/icons/Group';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { DefaultResultListItem } from './DefaultResultListItem';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen } from '@testing-library/react';
import { renderInTestApp } from '@backstage/test-utils';
import FindInPageIcon from '@material-ui/icons/FindInPage';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import { AnalyticsContext } from '@backstage/core-plugin-api';
import {
ResultHighlight,
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen } from '@testing-library/react';
import { renderInTestApp } from '@backstage/test-utils';
import { HighlightedSearchResultText } from './HighlightedSearchResultText';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useMemo } from 'react';
import { useMemo } from 'react';
import { makeStyles } from '@material-ui/core/styles';
/** @public */
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import LabelIcon from '@material-ui/icons/Label';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ChangeEvent, useCallback, useMemo } from 'react';
import { ChangeEvent, useCallback, useMemo } from 'react';
import CircularProgress from '@material-ui/core/CircularProgress';
import { makeStyles } from '@material-ui/core/styles';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText, {
ListItemTextProps,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import { makeStyles } from '@material-ui/core/styles';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, waitFor, act } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { configApiRef } from '@backstage/core-plugin-api';
@@ -26,7 +26,8 @@ import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import { TextFieldProps } from '@material-ui/core/TextField';
import DefaultSearchIcon from '@material-ui/icons/Search';
import React, {
import {
ReactNode,
ChangeEvent,
forwardRef,
KeyboardEvent,
@@ -49,7 +50,7 @@ export type SearchBarBaseProps = Omit<TextFieldProps, 'onChange'> & {
onClear?: () => void;
onSubmit?: () => void;
onChange: (value: string) => void;
endAdornment?: React.ReactNode;
endAdornment?: ReactNode;
};
/**
@@ -17,7 +17,6 @@
import { mockApis, TestApiProvider } from '@backstage/test-utils';
import { screen, render, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
import { searchApiRef } from '../../api';
import { SearchContextProvider, useSearch } from '../../context';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ChangeEvent, useState } from 'react';
import { ChangeEvent, useState } from 'react';
import Chip from '@material-ui/core/Chip';
import TextField from '@material-ui/core/TextField';
import Autocomplete, {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import Paper from '@material-ui/core/Paper';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactElement, ChangeEvent, useRef } from 'react';
import { ReactElement, ChangeEvent, useRef } from 'react';
import { capitalize } from 'lodash';
import { v4 as uuid } from 'uuid';
import FormControl from '@material-ui/core/FormControl';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { ApiProvider } from '@backstage/core-app-api';
import { mockApis, TestApiRegistry } from '@backstage/test-utils';
import { act, renderHook, waitFor } from '@testing-library/react';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import { TestApiProvider } from '@backstage/test-utils';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, {
import {
ReactNode,
ChangeEvent,
MouseEvent,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, PropsWithChildren } from 'react';
import { ComponentType, PropsWithChildren } from 'react';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { waitFor } from '@testing-library/react';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { createPlugin } from '@backstage/core-plugin-api';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import useAsync, { AsyncState } from 'react-use/esm/useAsync';
import { isFunction } from 'lodash';
@@ -14,12 +14,7 @@
* limitations under the License.
*/
import React, {
ComponentType,
useCallback,
useState,
PropsWithChildren,
} from 'react';
import { ComponentType, useCallback, useState, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -14,7 +14,8 @@
* limitations under the License.
*/
import React, {
import {
MouseEvent,
ChangeEvent,
PropsWithChildren,
ReactNode,
@@ -391,7 +392,7 @@ export function SearchResultGroupLayout<FilterOption>(
...rest
} = props;
const handleClick = useCallback((e: React.MouseEvent<HTMLButtonElement>) => {
const handleClick = useCallback((e: MouseEvent<HTMLButtonElement>) => {
setAnchorEl(e.currentTarget);
}, []);
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ComponentType, useState, PropsWithChildren } from 'react';
import { ComponentType, useState, PropsWithChildren } from 'react';
import Grid from '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen, waitFor } from '@testing-library/react';
import {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { ReactNode } from 'react';
import { ReactNode } from 'react';
import List, { ListProps } from '@material-ui/core/List';
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
import { waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -14,8 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import Button from '@material-ui/core/Button';
import { makeStyles } from '@material-ui/core/styles';
import ArrowBackIosIcon from '@material-ui/icons/ArrowBackIos';
@@ -23,7 +23,6 @@ import {
renderHook,
} from '@testing-library/react';
import { mockApis, TestApiProvider } from '@backstage/test-utils';
import React from 'react';
import {
SearchContextProvider,
useSearch,
@@ -15,7 +15,10 @@
*/
import { isEqual } from 'lodash';
import React, {
import {
SetStateAction,
Dispatch,
DispatchWithoutAction,
PropsWithChildren,
useCallback,
useContext,
@@ -46,13 +49,13 @@ import { searchApiRef } from '../api';
*/
export type SearchContextValue = {
result: AsyncState<SearchResultSet>;
setTerm: React.Dispatch<React.SetStateAction<string>>;
setTypes: React.Dispatch<React.SetStateAction<string[]>>;
setFilters: React.Dispatch<React.SetStateAction<JsonObject>>;
setPageLimit: React.Dispatch<React.SetStateAction<number | undefined>>;
setPageCursor: React.Dispatch<React.SetStateAction<string | undefined>>;
fetchNextPage?: React.DispatchWithoutAction;
fetchPreviousPage?: React.DispatchWithoutAction;
setTerm: Dispatch<SetStateAction<string>>;
setTypes: Dispatch<SetStateAction<string[]>>;
setFilters: Dispatch<SetStateAction<JsonObject>>;
setPageLimit: Dispatch<SetStateAction<number | undefined>>;
setPageCursor: Dispatch<SetStateAction<string | undefined>>;
fetchNextPage?: DispatchWithoutAction;
fetchPreviousPage?: DispatchWithoutAction;
} & SearchContextState;
/**
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, {
import {
Fragment,
ReactNode,
PropsWithChildren,