mirror of
https://github.com/mathuo/dockview
synced 2025-08-25 11:36:33 +00:00
Merge pull request #556 from mathuo/555-import-react-vs-import-as-react
chore: adjust react import
This commit is contained in:
commit
b09ab48cd8
@ -1,6 +1,6 @@
|
||||
import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import { DockviewDefaultTab } from '../../dockview/defaultTab';
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
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 { DockviewApi, IDockviewPanel } from 'dockview-core';
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
import { GridviewApi, IGridviewPanel, Orientation } from 'dockview-core';
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
import { IPaneviewPanel, PaneviewApi } from 'dockview-core';
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ReactPart, isReactComponent } from '../react';
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { render, screen, act } from '@testing-library/react';
|
||||
|
||||
interface TestInterface {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { act, render, waitFor } from '@testing-library/react';
|
||||
import { SplitviewApi, Orientation, ISplitviewPanel } from 'dockview-core';
|
||||
import {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { IDockviewPanelHeaderProps } from './dockview';
|
||||
import * as React from 'react';
|
||||
import { CloseButton } from '../svg';
|
||||
|
||||
export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps &
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
DockviewComponent,
|
||||
DockviewWillDropEvent,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import {
|
||||
IDockviewPanel,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import { IDockviewPanelProps } from '../dockview/dockview';
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import { IGroupPanelBaseProps } from './dockview';
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import { ReactPart, ReactPortalStore } from '../react';
|
||||
import {
|
||||
PanelUpdateEvent,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
GridviewComponent,
|
||||
IGridviewComponent,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
PaneviewPanelApi,
|
||||
PaneviewComponent,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
PanelUpdateEvent,
|
||||
IPaneBodyPart,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { IFrameworkPart, IDockviewDisposable, Parameters } from 'dockview-core';
|
||||
|
||||
export interface ReactPortalStore {
|
||||
@ -192,12 +192,11 @@ export const usePortalsLifecycle: PortalLifecycleHook = () => {
|
||||
return [portals, addPortal];
|
||||
};
|
||||
|
||||
|
||||
export function isReactComponent(component: any): boolean {
|
||||
/**
|
||||
* 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...
|
||||
*/
|
||||
/**
|
||||
* 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...
|
||||
*/
|
||||
return (
|
||||
typeof component === 'function' /** Functional Componnts */ ||
|
||||
!!(component as React.ExoticComponent)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
SplitviewApi,
|
||||
SplitviewPanelApi,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
|
||||
export const CloseButton = () => (
|
||||
<svg
|
||||
|
Loading…
x
Reference in New Issue
Block a user