-
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 #34008 from software-mansion-labs/@szymczak/Select…
…ionList [TS migration] Migrate 'SelectionList' component to TypeScript
- Loading branch information
Showing
15 changed files
with
505 additions
and
222 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,16 +1,17 @@ | ||
import React, {forwardRef} from 'react'; | ||
import type {ForwardedRef} from 'react'; | ||
import {SectionList as RNSectionList} from 'react-native'; | ||
import type ForwardedSectionList from './types'; | ||
import type {SectionListProps} from 'react-native'; | ||
|
||
// 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'; | ||
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} | ||
/> | ||
); | ||
} | ||
|
||
export default forwardRef(SectionList); |
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
Oops, something went wrong.