Q27.webp
soft_wind

Q27.webp

Kizspy | Question: 27
(Choose 1 answer)
Consider the following code using uselsFocused:
import React, {useEffect } from 'react';
import { Text } from 'react-native';
import { uselsFocused} from '@react-navigation/native';
function HomeScreen() {
}
const is Focused
useEffect(() => {
if (is Focused) {
usels Focused();
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'

Thông tin

Category
MMA301
Thêm bởi
soft_wind
Ngày thêm
Lượt xem
2,403
Lượt bình luận
9
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom