Removing bug with touchstart

This commit is contained in:
okbel
2021-02-18 13:24:46 -03:00
parent cbc354e0b6
commit 19db5a7e1d
2 changed files with 7 additions and 5 deletions

View File

@@ -50,10 +50,12 @@ const ProductSlider: FC = ({ children }) => {
)
return () => {
sliderContainerRef.current!.removeEventListener(
'touchstart',
preventNavigation
)
if (sliderContainerRef.current) {
sliderContainerRef.current!.removeEventListener(
'touchstart',
preventNavigation
)
}
}
}, [])