
Q61
Q61 What is the primary advantage of using Pressable over TouchableOpacity?
Pressable supports additional gesture states
Pressable has built-in animations
Pressable is more lightweight
Pressable is only available in React Native 0.50+
Q62
Q62 How do you attach an onPress event to a button?
<Button title="Click" onPress={handleClick} />
<Button title="Click" click={handleClick} />
<Button onClick={handleClick} />
<Button touch={handleClick} />
Q63
Q63 What will be the output of this code?
<TextInput onChangeText={(text) => console.log(text)} /> when the user types "Hello"?
Nothing
The app will crash
Logs Hello in the console
Shows an alert
Q64
Q64 How can you handle a long press event on a button?
Using onLongPress
Using onPress
Using handleLongPress
Using onTouch
Q65
Q65 Why does an onPress event sometimes not trigger inside a ScrollView?
The button is disabled
The ScrollView intercepts touch events
onPress is not supported inside ScrollView
The app crashed
Q66
Q66 Why is the keyboard not dismissing after typing in TextInput?
TextInput does not support keyboard dismissal
The keyboard needs manual closing
The app has a bug
The Keyboard.dismiss() method is missing
Q67
Q67 How can you prevent multiple button presses in quick succession?
Using setTimeout
Disabling the button after the first press
Using onPressPrevent
Using event.stopPropagation()
Q68
Q68 Which library is most commonly used for navigation in React Native?
React Router
React Navigation
Redux
NavigationX
Q69
Q69 Which navigator is used to create a stack-based navigation system?
DrawerNavigator
StackNavigator
TabNavigator
BottomNavigator
Q70
Q70 How do you navigate to a new screen in React Navigation?
navigation.push("ScreenName")
navigation.navigate("ScreenName")
navigation.goto("ScreenName")
navigation.load("ScreenName")
Q71
Q71 What is the purpose of navigation.goBack()?
Reloads the current screen
Returns to the previous screen
Closes the app
Renders the navigation stack
Q72
Q72 Which of the following statements is true about deep linking in React Navigation?
Deep linking allows opening a specific screen from a URL
Deep linking is only available for Android
Deep linking does not work with nested navigators
Deep linking is automatically enabled in React Navigation
Q73
Q73 How do you define a stack navigator in React Navigation?
createDrawerNavigator()
createStackNavigator()
createNavigationStack()
createTabNavigator()
Q74
Q74 What is the correct way to pass parameters while navigating to a screen?
navigation.navigate("Profile", { userId: 123 })
navigation.push("Profile", { userId: 123 })
navigation.send("Profile", { userId: 123 })
navigation.go("Profile", { userId: 123 })
Q75
Q75 How do you access the passed parameters inside a screen component?
props.params.userId
navigation.route.params.userId
route.params.userId
this.params.userId
Q76
Q76 How do you dynamically set the title of a screen in React Navigation?
navigation.title = "New Title"
setOptions({ title: "New Title" })
navigation.setTitle("New Title")
navigation.modifyTitle("New Title")
Q77
Q77 Why might navigation.navigate("Home") not work as expected?
The Home screen is missing
Navigation is not wrapped with a NavigationContainer
navigate is an invalid method
React Native does not support navigation
Q78
Q78 What is the best way to fix an issue where route.params is undefined?
Ensure the correct parameter is passed in navigate
Manually define params in the component state
Reinstall React Navigation
Convert the component into a class component
Q79
Q79 What could cause a "Navigator is undefined" error in React Navigation?
The app is missing a valid navigation stack
React Native does not support navigation
React Navigation requires Redux
The app needs to be restarted
Q80
Q80 Which function is commonly used for making HTTP requests in React Native?
fetch()
axios.get()
XMLHttpRequest()
Both fetch() and axios.get()
Q81
Q81 What is the primary advantage of using Axios over Fetch API?
Axios automatically parses JSON responses
Fetch API is faster
Axios only supports GET requests
Axios is built into React Native
Q82
Q82 What lifecycle method should be used to fetch data when a component mounts in a class component?
componentDidMount()
componentWillUpdate()
componentWillUnmount()
constructor()
Q83
Q83 What is the recommended way to handle API errors in React Native?
Ignore the errors
Use a try...catch block
Reload the application
Use console.log()
Q84
Q84 What is the best approach for handling loading state when fetching data?
Render a loading indicator until data is available
Display an error message immediately
Only fetch data after user interaction
Use setTimeout before making a request
Q85
Q85 What is the correct syntax for making a GET request using Fetch API?
fetch('https://api.example.com/data')
fetch.get('https://api.example.com/data')
axios.fetch('https://api.example.com/data')
get.fetch('https://api.example.com/data')
Q86
Q86 How do you handle API responses with fetch()?
fetch(url).then(res => res.json()).then(data => console.log(data))
fetch(url).then(res => console.log(res))
fetch(url).getData()
fetch(url).returnJson()
Q87
Q87 How can you cancel an ongoing API request in React Native using Axios?
axios.cancel()
source.cancel()
fetch.abort()
cancelRequest()
Q88
Q88 How do you handle multiple API calls simultaneously in React Native?
Use Promise.all()
Use setTimeout()
Make requests one by one
Wait for one request to finish before starting another
Q89
Q89 Why does fetch() sometimes fail when calling an API?
The API does not exist
Network issues or incorrect URL
fetch() does not work in React Native
APIs only work with Axios
Q90
Q90 Why does an API call return an empty response in React Native?
The API response is slow
The API requires authentication
The API does not support JSON
The request method is incorrect

