MMA301_-_FA_2024_-_FE_2972.webp
Mahito95

MMA301_-_FA_2024_-_FE_2972.webp

  • Media owner Mahito95
  • Ngày thêm
(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

Thông tin

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

Image metadata

Filename
MMA301_-_FA_2024_-_FE_2972.webp
File size
273 KB
Dimensions
1920px x 1012px

Share this media

Back
Bên trên Bottom