We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a5eb76 commit 6a4d2c8Copy full SHA for 6a4d2c8
1 file changed
src/hooks/navigation/useWeb.ts
@@ -29,12 +29,16 @@ export const useWeb: () => ReturnType = () => {
29
}
30
31
setDimensions(Dimensions.get('window').width, Dimensions.get('screen').width)
32
- Dimensions.addEventListener(
+ const subscription = Dimensions.addEventListener(
33
'change',
34
({ window: { width: windowWidth }, screen: { width: screenWidth } }) => {
35
setDimensions(windowWidth, screenWidth)
36
37
)
38
+
39
+ return () => {
40
+ subscription.remove()
41
+ }
42
}, [])
43
44
return {
0 commit comments