Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ export function patchFlatListProps(options = {}) {
function setCustomFlatListWeb(options) {
FlatList.defaultProps = {
...FlatList.defaultProps,
//eslint-disable-next-line react/display-name
renderScrollComponent: props => (
// eslint-disable-next-line react/display-name
renderScrollComponent: (props) => (
<ScrollView
{...props}
//eslint-disable-next-line react/prop-types
refreshControl={<CustomRefreshControl {...options} refreshing={props.refreshing} onRefresh={props.onRefresh} />}
// eslint-disable-next-line react/prop-types
refreshControl={
props.onRefresh
? (
<CustomRefreshControl
{...options}
refreshing={props.refreshing}
onRefresh={props.onRefresh}
/>
)
: props.refreshControl // fallback to existing refreshControl if any
}
/>
),
}
};
}