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

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 6584

Latest Images

Trending Articles



Latest Images