mirror of
https://github.com/apache/superset.git
synced 2026-06-01 13:49:21 +00:00
chore: remove React 16.4's obsolete React imports (#28571)
Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
@@ -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 userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
@@ -29,7 +28,7 @@ const createProps = (): Partial<PopoverProps> => ({
|
||||
content: <span data-test="control-popover-content">Information</span>,
|
||||
});
|
||||
|
||||
const TestComponent: React.FC<PopoverProps> = props => (
|
||||
const TestComponent: globalThis.React.FC<PopoverProps> = props => (
|
||||
<div id="controlSections">
|
||||
<div data-test="outer-container">
|
||||
<ControlPopover {...props}>
|
||||
@@ -42,7 +41,7 @@ const TestComponent: React.FC<PopoverProps> = props => (
|
||||
const setupTest = (props: Partial<PopoverProps> = createProps()) => {
|
||||
const setStateMock = jest.fn();
|
||||
jest
|
||||
.spyOn(React, 'useState')
|
||||
.spyOn(global.React, 'useState')
|
||||
.mockImplementation(((state: any) => [
|
||||
state,
|
||||
state === 'right' ? setStateMock : jest.fn(),
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React, { useCallback, useRef, useEffect, useState } from 'react';
|
||||
// eslint-disable-next-line no-restricted-syntax -- whole React import is required for `ControlPopover.test.tsx` Jest test passing.
|
||||
import React, { FC, useCallback, useRef, useEffect, useState } from 'react';
|
||||
|
||||
import Popover, {
|
||||
PopoverProps as BasePopoverProps,
|
||||
@@ -41,7 +42,7 @@ export type PopoverProps = BasePopoverProps & {
|
||||
getVisibilityRatio?: typeof getElementYVisibilityRatioOnContainer;
|
||||
};
|
||||
|
||||
const ControlPopover: React.FC<PopoverProps> = ({
|
||||
const ControlPopover: FC<PopoverProps> = ({
|
||||
getPopupContainer,
|
||||
getVisibilityRatio = getElementYVisibilityRatioOnContainer,
|
||||
visible: visibleProp,
|
||||
|
||||
Reference in New Issue
Block a user