Skip to content

Commit

Permalink
chore: add legacy implementation explanation comment
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbej committed Oct 30, 2023
1 parent 0a3db4f commit ed08c33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/*
TODO: A comment describing the purpose of this file **and why the types are duplicated between here and `PagerViewNativeComponent.tsx`**
Note: The types below are duplicated between this file and `src/PagerViewNativeComponent/PagerViewNativeComponent.ts`.
This is on purpose. Firstly, we're declaring two native modules with two different iOS implementation flavors, but the same API.
Secondly, as these files serve as a reference point for React Native's new architecture Codegen process (which takes care of the
automatic generation of the native modules) we cannot extract the types into a separate file, or declare both native modules
in one file, as Codegen supports neither of these workarounds at the time of writing.
In order to make things as intuitive as possible, the duplicated types in this file are *not* exported, as they are meant for use
in this file only, by Codegen-related functions.
*/
import type * as React from 'react';
import type { HostComponent, ViewProps } from 'react-native';
Expand Down
1 change: 0 additions & 1 deletion src/PagerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import LEGACY_PagerViewNativeComponent, {
* }
* ```
*/

export class PagerView extends React.Component<PagerViewProps> {
private isScrolling = false;
pagerView: React.ElementRef<typeof PagerViewNativeComponent> | null = null;
Expand Down

0 comments on commit ed08c33

Please sign in to comment.