-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 #34733 from Expensify/revert-34008-@szymczak/Selec…
…tionList Revert "[TS migration] Migrate 'SelectionList' component to TypeScript"
- Loading branch information
Showing
15 changed files
with
222 additions
and
505 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 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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import React, {forwardRef} from 'react'; | ||
import type {ForwardedRef} from 'react'; | ||
import {SectionList as RNSectionList} from 'react-native'; | ||
import type {SectionListProps} from 'react-native'; | ||
import type ForwardedSectionList from './types'; | ||
|
||
// eslint-disable-next-line react/function-component-definition | ||
function SectionList<ItemT, SectionT>(props: SectionListProps<ItemT, SectionT>, ref: ForwardedRef<RNSectionList<ItemT, SectionT>>) { | ||
return ( | ||
<RNSectionList | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
ref={ref} | ||
/> | ||
); | ||
} | ||
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 type {ForwardedRef} from 'react'; | ||
import type {SectionList, SectionListProps} from 'react-native'; | ||
|
||
type ForwardedSectionList = { | ||
(props: SectionListProps<SectionList>, ref: ForwardedRef<SectionList>): React.ReactNode; | ||
displayName: string; | ||
}; | ||
|
||
export default ForwardedSectionList; |
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
Oops, something went wrong.