Skip to content

Commit af185e0

Browse files
committed
Remove onLayout
1 parent 3deed40 commit af185e0

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

components/Swiper.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default function Swiper({style, data, isStaticPills, initialScrollIndex,
1212
const flatList = useRef(null);
1313
const scrollViewRef = useRef(null);
1414
const [currentIndex, setCurrentIndex] = useState(initialScrollIndex || 0);
15-
const [pillContainerHeight, setPillContainerHeight] = useState(0);
1615
const prevIndex = usePrevious(currentIndex);
1716
const buttonsCoords = React.useRef([]).current;
1817
const [x, setX] = useState(0);
@@ -63,15 +62,8 @@ export default function Swiper({style, data, isStaticPills, initialScrollIndex,
6362
scrollableContainer={scrollableContainer}
6463
>
6564
{children}
66-
<View style={{
67-
overflow: 'hidden',
68-
height: pillContainerHeight + 10,
69-
}}>
65+
<View style={[style?.pillsOverflow]}>
7066
<View
71-
onLayout={(event) => {
72-
let {x, y, width, height} = event.nativeEvent.layout;
73-
setPillContainerHeight(height)
74-
}}
7567
style={[
7668
styles.pillContainer,
7769
isStaticPills && styles.staticPillContainer,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-screens-swiper",
3-
"version": "1.1.7",
3+
"version": "1.1.9",
44
"description": "This lib. provide swiper view functionality with tab navigation on the top.",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)