Skip to content

Commit a099306

Browse files
authored
fix: fix circular-depdcy (#982)
1 parent 6a6dbaa commit a099306

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/Table.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import warning from 'rc-util/lib/warning';
3838
import * as React from 'react';
3939
import Body from './Body';
4040
import ColGroup from './ColGroup';
41-
import { EXPAND_COLUMN } from './constant';
41+
import { EXPAND_COLUMN, INTERNAL_HOOKS } from './constant';
4242
import TableContext from './context/TableContext';
4343
import type { FixedHeaderProps } from './FixedHolder';
4444
import FixedHolder from './FixedHolder';
@@ -82,8 +82,6 @@ const EMPTY_DATA = [];
8282
// Used for customize scroll
8383
const EMPTY_SCROLL_TARGET = {};
8484

85-
export const INTERNAL_HOOKS = 'rc-table-internal-hook';
86-
8785
export interface TableProps<RecordType = unknown>
8886
extends Omit<LegacyExpandableProps<RecordType>, 'showExpandColumn'> {
8987
prefixCls?: string;

src/constant.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export const EXPAND_COLUMN = {} as const;
2+
3+
export const INTERNAL_HOOKS = 'rc-table-internal-hook';

src/hooks/useExpand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import warning from 'rc-util/lib/warning';
22
import * as React from 'react';
3+
import { INTERNAL_HOOKS } from '../constant';
34
import type {
45
ExpandableConfig,
56
ExpandableType,
@@ -9,7 +10,6 @@ import type {
910
TriggerEventHandler,
1011
} from '../interface';
1112
import type { TableProps } from '../Table';
12-
import { INTERNAL_HOOKS } from '../Table';
1313
import { findAllChildrenKeys, renderExpandIcon } from '../utils/expandUtil';
1414
import { getExpandableProps } from '../utils/legacyUtil';
1515

tests/Internal.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
21
import { mount } from 'enzyme';
2+
import React from 'react';
33
import Table from '../src';
4-
import { INTERNAL_HOOKS } from '../src/Table';
4+
import { INTERNAL_HOOKS } from '../src/constant';
55

66
// All follow test is only for internal usage which should be removed when refactor
77
describe('Table.Internal', () => {

tests/Table.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react';
44
import Table, { INTERNAL_COL_DEFINE } from '../src';
55
import BodyRow from '../src/Body/BodyRow';
66
import Cell from '../src/Cell';
7-
import { INTERNAL_HOOKS } from '../src/Table';
7+
import { INTERNAL_HOOKS } from '../src/constant';
88

99
describe('Table.Basic', () => {
1010
const data = [

0 commit comments

Comments
 (0)