Skip to content

Commit ad879ce

Browse files
committed
refactor(container): remove unused height
1 parent 39443be commit ad879ce

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

lib/src/components/Container.tsx

-12
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ const Container: FC<ContainerProps> = ({children}) => {
7171
const heightCollapsed = useRef<number>(50)
7272
const heightExpanded = useRef<number>(50)
7373
const heightKnob = useRef<number>(50)
74-
const height = useSharedValue<number>(50)
7574
const heightOffset = useSharedValue<number>(0)
7675
const pressed = useSharedValue<boolean>(false)
7776
const expanded = useSharedValue<boolean>(false)
@@ -96,14 +95,6 @@ const Container: FC<ContainerProps> = ({children}) => {
9695
}
9796
})
9897

99-
const updateHeight = () => {
100-
if (!pressed.value) {
101-
height.value =
102-
(expanded.value ? heightExpanded.current : heightCollapsed.current) +
103-
heightKnob.current
104-
}
105-
}
106-
10798
return (
10899
<GestureHandlerRootView>
109100
<Animated.View style={[styles.wrapper, animateHeightStyles]}>
@@ -112,7 +103,6 @@ const Container: FC<ContainerProps> = ({children}) => {
112103
style={styles.containerExpanded}
113104
onLayout={(e) => {
114105
heightExpanded.current = e.nativeEvent.layout.height
115-
updateHeight()
116106
}}>
117107
{expandedChildren}
118108
</SectionContainer>
@@ -122,7 +112,6 @@ const Container: FC<ContainerProps> = ({children}) => {
122112
style={animateCollapsedStyles}
123113
onLayout={(e) => {
124114
heightCollapsed.current = e.nativeEvent.layout.height
125-
updateHeight()
126115
}}>
127116
{collapsedChildren}
128117
</SectionContainer>
@@ -137,7 +126,6 @@ const Container: FC<ContainerProps> = ({children}) => {
137126
heightKnob={heightKnob}
138127
onLayout={(e) => {
139128
heightKnob.current = e.nativeEvent.layout.height
140-
updateHeight()
141129
}}
142130
pressed={pressed}
143131
expanded={expanded}>

0 commit comments

Comments
 (0)