The code uses navigation.navigate but navigation is not passed or imported in the function.
Step 2: Verify other options
Button supports onPress, navigate is correct method, and Title prop is case-sensitive but correct here.
Final Answer:
navigation is not defined inside HomeScreen -> Option A
Quick Check:
navigation must be defined or passed = A [OK]
Hint: Always pass or get navigation prop in screen components [OK]
Common Mistakes:
Forgetting to get navigation prop
Misnaming navigate method
Misunderstanding Button props
5. You want to allow users to go back to the previous screen after navigating forward. Which React Navigation method should you use to manage this screen flow?
hard
A. navigation.goBack()
B. navigation.reset()
C. navigation.push('ScreenName')
D. navigation.replace('ScreenName')
Solution
Step 1: Understand navigation.goBack()
This method moves the user back to the previous screen in the navigation stack.
Step 2: Compare with other methods
reset clears history, push adds a new screen, replace swaps current screen; only goBack moves backward.
Final Answer:
navigation.goBack() -> Option A
Quick Check:
Go back to previous screen = goBack() = D [OK]
Hint: Use goBack() to return to previous screen [OK]
Common Mistakes:
Using reset to go back (it clears history)
Confusing push with goBack
Thinking replace goes back
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.