-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29745 from software-mansion-labs/ts-migration/sec…
…tion-list-component [TS migration] Migrate 'SectionList' component to TypeScript
- Loading branch information
Showing
4 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, {forwardRef} from 'react'; | ||
import {SectionList as RNSectionList} from 'react-native'; | ||
import ForwardedSectionList from './types'; | ||
|
||
// eslint-disable-next-line react/function-component-definition | ||
const SectionList: ForwardedSectionList = (props, ref) => ( | ||
<RNSectionList | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
|
||
SectionList.displayName = 'SectionList'; | ||
|
||
export default forwardRef(SectionList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {ForwardedRef} from 'react'; | ||
import {SectionList, SectionListProps} from 'react-native'; | ||
|
||
type ForwardedSectionList = { | ||
(props: SectionListProps<SectionList>, ref: ForwardedRef<SectionList>): React.ReactNode; | ||
displayName: string; | ||
}; | ||
|
||
export default ForwardedSectionList; |