mirror of
https://github.com/mathuo/dockview
synced 2025-08-29 13:36:31 +00:00
chore: adjust react import
This commit is contained in:
parent
09edbddf72
commit
61eaae30c8
@ -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';
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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 &
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
DockviewComponent,
|
DockviewComponent,
|
||||||
DockviewWillDropEvent,
|
DockviewWillDropEvent,
|
||||||
|
@ -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,
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
@ -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,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
GridviewComponent,
|
GridviewComponent,
|
||||||
IGridviewComponent,
|
IGridviewComponent,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
PaneviewPanelApi,
|
PaneviewPanelApi,
|
||||||
PaneviewComponent,
|
PaneviewComponent,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
PanelUpdateEvent,
|
PanelUpdateEvent,
|
||||||
IPaneBodyPart,
|
IPaneBodyPart,
|
||||||
|
@ -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)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
SplitviewApi,
|
SplitviewApi,
|
||||||
SplitviewPanelApi,
|
SplitviewPanelApi,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export const CloseButton = () => (
|
export const CloseButton = () => (
|
||||||
<svg
|
<svg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user