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
+3 -5
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useCallback } from 'react';
import { PropsWithChildren, ComponentType, useCallback } from 'react';
import { useOutlet } from 'react-router-dom';
import {
@@ -43,9 +43,7 @@ export const TECHDOCS_ADDONS_WRAPPER_KEY = 'techdocs.addons.wrapper.v1';
* TechDocs Addon registry.
* @public
*/
export const TechDocsAddons: React.ComponentType<
React.PropsWithChildren<{}>
> = () => null;
export const TechDocsAddons: ComponentType<PropsWithChildren<{}>> = () => null;
attachComponentData(TechDocsAddons, TECHDOCS_ADDONS_WRAPPER_KEY, true);
@@ -74,7 +72,7 @@ export function createTechDocsAddonExtension<TComponentProps>(
* @public
*/
export function createTechDocsAddonExtension<
TComponentProps extends React.PropsWithChildren<{}>,
TComponentProps extends PropsWithChildren<{}>,
>(
options: TechDocsAddonOptions<TComponentProps>,
): Extension<(props: TComponentProps) => JSX.Element | null> {
+3 -3
View File
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { createElement, ComponentType } from 'react';
import { TechDocsAddonOptions } from './types';
import {
attachComponentData,
getComponentData,
} from '@backstage/core-plugin-api';
import { ComponentType } from 'react';
import { getDataKeyByName, TECHDOCS_ADDONS_KEY } from './addons';
import {
createExtensionBlueprint,
@@ -57,7 +57,7 @@ export const attachTechDocsAddonComponentData = <P>(
techDocsAddon: ComponentType<P>,
data: TechDocsAddonOptions,
) => {
const element = React.createElement(techDocsAddon as ComponentType);
const element = createElement(techDocsAddon as ComponentType);
const isDataAttached = getComponentData<TechDocsAddonOptions>(
element,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, { useState, useEffect } from 'react';
import { useState, useEffect } from 'react';
import { render, waitFor, screen } from '@testing-library/react';
import {
SHADOW_DOM_STYLE_LOAD_EVENT,
+1 -6
View File
@@ -14,12 +14,7 @@
* limitations under the License.
*/
import React, {
PropsWithChildren,
useState,
useEffect,
useCallback,
} from 'react';
import { PropsWithChildren, useState, useEffect, useCallback } from 'react';
import { create } from 'jss';
import StylesProvider from '@material-ui/styles/StylesProvider';
+2 -2
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { ReactNode } from 'react';
import { renderHook, act, waitFor } from '@testing-library/react';
import { ThemeProvider } from '@material-ui/core/styles';
@@ -75,7 +75,7 @@ const wrapper = ({
}: {
entityRef?: CompoundEntityRef;
config?: JsonObject;
children: React.ReactNode;
children: ReactNode;
}) => (
<ThemeProvider theme={lightTheme}>
<TestApiProvider
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React, {
import {
Dispatch,
SetStateAction,
useContext,