chore: adjust react import

This commit is contained in:
mathuo 2024-03-16 21:16:57 +00:00
parent 09edbddf72
commit 61eaae30c8
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
18 changed files with 23 additions and 24 deletions

View File

@ -1,6 +1,6 @@
import { fireEvent, render, screen } from '@testing-library/react'; import { fireEvent, render, screen } from '@testing-library/react';
import { DockviewDefaultTab } from '../../dockview/defaultTab'; import { DockviewDefaultTab } from '../../dockview/defaultTab';
import * as React from 'react'; import React from 'react';
import { fromPartial } from '@total-typescript/shoehorn'; import { fromPartial } from '@total-typescript/shoehorn';
import { DockviewApi, DockviewPanelApi } from 'dockview-core'; import { DockviewApi, DockviewPanelApi } from 'dockview-core';

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { act, render, waitFor } from '@testing-library/react'; import { act, render, waitFor } from '@testing-library/react';
import { DockviewApi, IDockviewPanel } from 'dockview-core'; import { DockviewApi, IDockviewPanel } from 'dockview-core';
import { import {

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { act, render, waitFor } from '@testing-library/react'; import { act, render, waitFor } from '@testing-library/react';
import { GridviewApi, IGridviewPanel, Orientation } from 'dockview-core'; import { GridviewApi, IGridviewPanel, Orientation } from 'dockview-core';
import { import {

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { act, render, waitFor } from '@testing-library/react'; import { act, render, waitFor } from '@testing-library/react';
import { IPaneviewPanel, PaneviewApi } from 'dockview-core'; import { IPaneviewPanel, PaneviewApi } from 'dockview-core';
import { import {

View File

@ -1,5 +1,5 @@
import { ReactPart, isReactComponent } from '../react'; import { ReactPart, isReactComponent } from '../react';
import * as React from 'react'; import React from 'react';
import { render, screen, act } from '@testing-library/react'; import { render, screen, act } from '@testing-library/react';
interface TestInterface { interface TestInterface {

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { act, render, waitFor } from '@testing-library/react'; import { act, render, waitFor } from '@testing-library/react';
import { SplitviewApi, Orientation, ISplitviewPanel } from 'dockview-core'; import { SplitviewApi, Orientation, ISplitviewPanel } from 'dockview-core';
import { import {

View File

@ -1,5 +1,5 @@
import React from 'react';
import { IDockviewPanelHeaderProps } from './dockview'; import { IDockviewPanelHeaderProps } from './dockview';
import * as React from 'react';
import { CloseButton } from '../svg'; import { CloseButton } from '../svg';
export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps & export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps &

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { import {
DockviewComponent, DockviewComponent,
DockviewWillDropEvent, DockviewWillDropEvent,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { ReactPart, ReactPortalStore } from '../react'; import { ReactPart, ReactPortalStore } from '../react';
import { import {
IDockviewPanel, IDockviewPanel,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { ReactPart, ReactPortalStore } from '../react'; import { ReactPart, ReactPortalStore } from '../react';
import { IDockviewPanelProps } from '../dockview/dockview'; import { IDockviewPanelProps } from '../dockview/dockview';
import { import {

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { ReactPart, ReactPortalStore } from '../react'; import { ReactPart, ReactPortalStore } from '../react';
import { IGroupPanelBaseProps } from './dockview'; import { IGroupPanelBaseProps } from './dockview';
import { import {

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { ReactPart, ReactPortalStore } from '../react'; import { ReactPart, ReactPortalStore } from '../react';
import { import {
PanelUpdateEvent, PanelUpdateEvent,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { import {
GridviewComponent, GridviewComponent,
IGridviewComponent, IGridviewComponent,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { import {
PaneviewPanelApi, PaneviewPanelApi,
PaneviewComponent, PaneviewComponent,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { import {
PanelUpdateEvent, PanelUpdateEvent,
IPaneBodyPart, IPaneBodyPart,

View File

@ -1,5 +1,5 @@
import * as React from 'react'; import React from 'react';
import * as ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { IFrameworkPart, IDockviewDisposable, Parameters } from 'dockview-core'; import { IFrameworkPart, IDockviewDisposable, Parameters } from 'dockview-core';
export interface ReactPortalStore { export interface ReactPortalStore {
@ -192,12 +192,11 @@ export const usePortalsLifecycle: PortalLifecycleHook = () => {
return [portals, addPortal]; return [portals, addPortal];
}; };
export function isReactComponent(component: any): boolean { export function isReactComponent(component: any): boolean {
/** /**
* Yes, we could use "react-is" but that would introduce an unwanted peer dependency * Yes, we could use "react-is" but that would introduce an unwanted peer dependency
* so for now we will check in a rather crude fashion... * so for now we will check in a rather crude fashion...
*/ */
return ( return (
typeof component === 'function' /** Functional Componnts */ || typeof component === 'function' /** Functional Componnts */ ||
!!(component as React.ExoticComponent) !!(component as React.ExoticComponent)

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
import { import {
SplitviewApi, SplitviewApi,
SplitviewPanelApi, SplitviewPanelApi,

View File

@ -1,4 +1,4 @@
import * as React from 'react'; import React from 'react';
export const CloseButton = () => ( export const CloseButton = () => (
<svg <svg