chore: remove React 16.4's obsolete React imports (#28571)

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
Đỗ Trọng Hải
2024-06-05 18:13:24 +07:00
committed by GitHub
parent 8a8ce16a1f
commit 0ca42a8e4d
1173 changed files with 1360 additions and 1880 deletions

View File

@@ -17,7 +17,6 @@
* under the License.
*/
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import { Provider } from 'react-redux';

View File

@@ -17,7 +17,7 @@
* under the License.
*/
/* eslint-disable camelcase */
import React, {
import {
Dispatch,
SetStateAction,
useCallback,

View File

@@ -16,7 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useCallback, useEffect, useMemo, useState, ReactNode } from 'react';
import { useSelector } from 'react-redux';
import { AdhocColumn, t, isAdhocColumn } from '@superset-ui/core';
import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls';
@@ -34,7 +35,7 @@ interface ColumnSelectPopoverTriggerProps {
visible?: boolean;
togglePopover?: (visible: boolean) => void;
closePopover?: () => void;
children: React.ReactNode;
children: ReactNode;
isTemporal?: boolean;
disabledTabs?: Set<string>;
}

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { t } from '@superset-ui/core';
import { DndItemType } from 'src/explore/components/DndItemType';
import AdhocFilterPopoverTrigger from 'src/explore/components/controls/FilterControl/AdhocFilterPopoverTrigger';

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { render, screen } from 'spec/helpers/testing-library';
import {
DndColumnSelect,

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useCallback, useMemo, useState } from 'react';
import { useCallback, useMemo, useState } from 'react';
import {
AdhocColumn,
tn,

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { t, styled } from '@superset-ui/core';
import { Input } from 'src/components/Input';
import { Tooltip } from 'src/components/Tooltip';

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import {
logging,
Metric,

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import userEvent from '@testing-library/user-event';
import {
render,

View File

@@ -17,7 +17,7 @@
* under the License.
*/
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import {
ensureIsArray,
GenericDataType,

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { useContext } from 'react';
import userEvent from '@testing-library/user-event';
import { render, screen } from 'spec/helpers/testing-library';
import { DndItemType } from 'src/explore/components/DndItemType';
@@ -35,7 +35,7 @@ const defaultProps: DndSelectLabelProps = {
onClickGhostButton: jest.fn(),
};
const MockChildren = () => {
const [zones] = React.useContext(DropzoneContext);
const [zones] = useContext(DropzoneContext);
return (
<>
{Object.keys(zones).map(key => (

View File

@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, {
ReactNode,
useCallback,
useContext,
useEffect,
useMemo,
} from 'react';
import { ReactNode, useCallback, useContext, useEffect, useMemo } from 'react';
import { useDrop } from 'react-dnd';
import { t, useTheme } from '@superset-ui/core';
import ControlHeader from 'src/explore/components/ControlHeader';

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { render, screen } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
import Option from 'src/explore/components/controls/DndColumnSelectControl/Option';

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useCallback } from 'react';
import { useCallback } from 'react';
import { styled, t, useTheme } from '@superset-ui/core';
import Icons from 'src/components/Icons';
import {

View File

@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { render, screen, fireEvent } from 'spec/helpers/testing-library';
import { DndItemType } from 'src/explore/components/DndItemType';
import OptionWrapper from 'src/explore/components/controls/DndColumnSelectControl/OptionWrapper';

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useRef } from 'react';
import { useRef } from 'react';
import {
useDrag,
useDrop,

View File

@@ -17,7 +17,13 @@
* under the License.
*/
import React, { useCallback, useEffect, useState } from 'react';
import {
useCallback,
useEffect,
useState,
MouseEvent as ReactMouseEvent,
} from 'react';
import { throttle } from 'lodash';
import {
POPOVER_INITIAL_HEIGHT,
@@ -50,7 +56,7 @@ export default function useResizeButton(
setIsDragging(false);
}, []);
const onDragDown = useCallback((ev: React.MouseEvent): void => {
const onDragDown = useCallback((ev: ReactMouseEvent): void => {
setDragStartX(ev.clientX);
setDragStartY(ev.clientY);
setIsDragging(true);