From 145f80409d3d86f20a95c6b3982099f769eb7a9a Mon Sep 17 00:00:00 2001 From: Julian Hundeloh Date: Wed, 14 Nov 2018 14:54:48 +0100 Subject: [PATCH] [fix] ScrollView dependency on 'style' forwarding for sticky headers Not every item that may be rendered by a ScrollView will forward 'style', so cloning the item element is not safe. Instead, we can wrap the item in a 'View' and apply the styles for the sticky header to this element. Close #1175 --- packages/react-native-web/src/exports/ScrollView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-web/src/exports/ScrollView/index.js b/packages/react-native-web/src/exports/ScrollView/index.js index cf330f1f..4574b2dd 100644 --- a/packages/react-native-web/src/exports/ScrollView/index.js +++ b/packages/react-native-web/src/exports/ScrollView/index.js @@ -168,7 +168,7 @@ const ScrollView = createReactClass({ !horizontal && Array.isArray(stickyHeaderIndices) ? React.Children.map(this.props.children, (child, i) => { if (child && stickyHeaderIndices.indexOf(i) > -1) { - return React.cloneElement(child, { style: [child.props.style, styles.stickyHeader] }); + return {child}; } else { return child; }