Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit ad0c362

Browse files
authored
fix: type export warning in webpack (#981)
1 parent 6d517b9 commit ad0c362

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

src/index.tsx

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
export { default as TabView, Props as TabViewProps } from './TabView';
2-
export { default as TabBar, Props as TabBarProps } from './TabBar';
3-
export {
4-
default as TabBarIndicator,
5-
Props as TabBarIndicatorProps,
6-
} from './TabBarIndicator';
1+
import * as tv from './TabView';
2+
import * as tb from './TabBar';
3+
import * as tbi from './TabBarIndicator';
4+
import * as types from './types';
5+
6+
// help babel to transpile the types correctly
7+
export type TabViewProps<T extends types.Route> = tv.Props<T>;
8+
export type TabBarProps<T extends types.Route> = tb.Props<T>;
9+
export type TabBarIndicatorProps<T extends types.Route> = tbi.Props<T>;
10+
export type Route = types.Route;
11+
export type NavigationState<T extends types.Route> = types.NavigationState<T>;
12+
export type SceneRendererProps = types.SceneRendererProps;
13+
14+
export { default as TabView } from './TabView';
15+
export { default as TabBar } from './TabBar';
16+
export { default as TabBarIndicator } from './TabBarIndicator';
717
export { default as SceneMap } from './SceneMap';
818
export { default as ScrollPager } from './ScrollPager';
9-
10-
export { Route, NavigationState, SceneRendererProps } from './types';

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"resolveJsonModule": true,
2222
"skipLibCheck": true,
2323
"strict": true,
24-
"target": "esnext"
24+
"target": "esnext",
25+
"isolatedModules": true,
2526
}
2627
}

0 commit comments

Comments
 (0)