Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

react navigation : useIsFocused usage fails test cases

$
0
0

I added the useIsFocused() to my file to accommodate focus event like

file.js

import { useIsFocused, useNavigation } from "@react-navigation/native"const navigation = useNavigation()    const isFocused = useIsFocused()useEffect(() => {      getData(somedata)    }, [isFocused])

But when i run my test file, the test fails

TypeError: navigation.isFocused is not a function

am I missing something here??


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>