File tree 2 files changed +16
-8
lines changed
2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @shopify/flash-list" ,
3
- "version" : " 2.0.0-alpha.1 " ,
3
+ "version" : " 2.0.0-alpha.2 " ,
4
4
"keywords" : [
5
5
" react-native" ,
6
6
" recyclerview" ,
Original file line number Diff line number Diff line change 1
- import { RecyclerView } from "./recyclerview/RecyclerView" ;
2
- import LegacyFlashList from "./FlashList" ;
1
+ import { default as OriginalFlashList } from "./FlashList" ;
3
2
import { isNewCoreEnabled } from "./enableNewCore" ;
3
+ import { RecyclerView } from "./recyclerview/RecyclerView" ;
4
4
5
- const FlashList = ( isNewCoreEnabled ( )
6
- ? RecyclerView
7
- : LegacyFlashList ) as unknown as typeof LegacyFlashList ;
8
-
9
- export { FlashList } ;
5
+ // Keep this unmodified for TS type checking
6
+ export { default as FlashList } from "./FlashList" ;
10
7
export {
11
8
FlashListProps ,
12
9
ContentStyle ,
@@ -54,3 +51,14 @@ export { default as CellContainer } from "./native/cell-container/CellContainer"
54
51
export { RecyclerView } from "./recyclerview/RecyclerView" ;
55
52
export { RecyclerViewProps } from "./recyclerview/RecyclerViewProps" ;
56
53
export { useRecyclerViewContext } from "./recyclerview/RecyclerViewContextProvider" ;
54
+
55
+ // @ts -ignore - This is ignored by TypeScript but will be present in the compiled JS
56
+ // In the compiled JS, this will override the previous FlashList export with a conditional one
57
+ if ( typeof module !== "undefined" && module . exports ) {
58
+ Object . defineProperty ( module . exports , "FlashList" , {
59
+ get : function ( ) {
60
+ return isNewCoreEnabled ( ) ? RecyclerView : OriginalFlashList ;
61
+ } ,
62
+ configurable : true ,
63
+ } ) ;
64
+ }
You can’t perform that action at this time.
0 commit comments