Q31.webp
Enmu90

Q31.webp

  • Media owner Enmu90
  • Ngày thêm
Question: 31
(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
Enmu90
Ngày thêm
Lượt xem
2,108
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom