From 752c98d61785be634b4dd4f30cd44767b476f32b Mon Sep 17 00:00:00 2001 From: Indraneel Patil Date: Tue, 8 Apr 2025 09:06:11 -0700 Subject: [PATCH 1/2] Only set custom refresh control if user sets onRefresh --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 7449fe4..5b3ac74 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,11 @@ function setCustomFlatListWeb(options) { } + refreshControl={ + props.onRefresh + ? ( + ) + : props.refreshControl} // fallback to existing refreshControl if any /> ), } From fa0fdf706b933de08578678a6150d1c74aef5178 Mon Sep 17 00:00:00 2001 From: Indraneel Patil Date: Tue, 8 Apr 2025 09:09:24 -0700 Subject: [PATCH 2/2] formatting --- src/index.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 5b3ac74..012668a 100644 --- a/src/index.js +++ b/src/index.js @@ -16,17 +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) => ( ) - : props.refreshControl} // fallback to existing refreshControl if any + + ) + : props.refreshControl // fallback to existing refreshControl if any + } /> ), - } + }; }