# React Native Quiz

## Question 1

Can you put a string directly inside a `View` component?

A) Yes, it renders as text
B) No, all text must be inside a `Text` component
C) Yes on iOS, no on Android
D) Only if you use a special prop

<!-- ANSWER: B -->
<!-- EXPLANATION: React Native requires all text to be wrapped in a Text component. Putting a string directly in a View will throw an error. This is different from the web where text can be direct children of divs. -->

## Question 2

What is the main performance advantage of FlatList over ScrollView with a mapped array?

A) FlatList uses less memory
B) FlatList only renders visible items (virtualization)
C) FlatList has built-in caching
D) ScrollView is slower on Android only

<!-- ANSWER: B -->
<!-- EXPLANATION: FlatList virtualizes the list — it only mounts components for items near the viewport, plus a small buffer. ScrollView with map() renders every item at once, which can cause performance issues with hundreds of items. -->

## Question 3

How do you pass data when navigating to another screen with React Navigation?

A) Through global state only
B) As the second argument to navigate: `navigate('Screen', { id: 1 })`
C) Through a shared context
D) By mutating the navigator's state

<!-- ANSWER: B -->
<!-- EXPLANATION: navigation.navigate('ScreenName', { param1: value1 }) passes params to the destination screen. The destination receives them via route.params. -->

## Question 4

What does the React Native Bridge do?

A) Connects to a remote server
B) Serializes messages between the JS thread and native thread
C) Manages React state
D) Handles touch events only

<!-- ANSWER: B -->
<!-- EXPLANATION: The Bridge is the communication layer between the JavaScript thread (where your React code runs) and the native thread (where UI is rendered). Commands are serialized and sent across it. -->

## Question 5

When would you choose Expo over a bare React Native project?

A) When you need maximum native customization
B) When you want fast setup and don't need custom native code
C) Only for iOS
D) Expo is deprecated

<!-- ANSWER: B -->
<!-- EXPLANATION: Expo offers fast setup, over-the-air updates, and a managed workflow. Choose it when you don't need custom native modules. Use bare RN when you need full native control. -->
