(Choose 1 answer)
Consider the following code using usels Focused:
import React, {useEffect } from 'react';import {Text} from 'react-native';
import { usels Focused} from '@react-navigation/native';
function HomeScreen() { const is Focused = usels Focused();
useEffect(() => { if (isFocused) { console.log('HomeScreen is focused');} else { console.log('HomeScreen is not focused');}}, [isFocused]);
return <Text>Home Screen</Text>;}
What will be logged if the component is initially focused and then loses focus?
A. 'HomeScreen is focused' initially, followed by 'HomeScreen is not focused'
B. 'HomeScreen is focused' only
C. 'HomeScreen is not focused' only
D. 'HomeScreen is not focused' initially, followed by 'HomeScreen is focused'
27