What React Native component is used to contain other elements and apply layout styles?
<View>
What prop changes the color of text in React Native’s <Text> component?
A. fontColor
B. color
C. textColor
D. tintColor
B
Which React Native object is used to create and organize styles?
StyleSheet
What is the main purpose of the <TouchableHighlight> component?
It makes a component respond to touch events (like a button).
Which prop sets the placeholder text that appears when the input is empty?
placeholder
Which component lets you input numbers only?
A. <Input type="number" />
B. <TextInput keyboardType="numeric" />
C. <NumericInput />
D. <NumberBox />
B
How do you center text horizontally?
textAlign: 'center'
What layout system does React Native use to position components?
Flexbox
Which prop is used to detect when the user presses the component?
onPress
Which prop allows you to control the value of a TextInput with state?
value
How do you pass a parameter to a function in onPress?
onPress={() => myFunction(param)}
Use an arrow function
How do you make text italic?
fontStyle: 'italic'
Which style property controls how components are aligned horizontally in a container using Flexbox?
justifyContent
What happens visually when a <TouchableHighlight> is pressed by default?
The background temporarily darkens (or “highlights”) to give feedback.
Which prop is used to detect changes in the text as the user types?
onChangeText
Which layout system positions components?
Flexbox
Which style property adds space outside a component, between it and other components?
margin
Which style property controls how components are aligned vertically in a container using Flexbox?
alignItems
What must you wrap inside a <TouchableHighlight> for it to display something on screen?
A visible component like <Text>, <View>, or an <Image>
Which programming language is primarily used in React Native?
JavaScript
Which property makes text bold?
fontWeight: 'bold'
What happens if you set both padding and margin on a component?
Padding adds space inside the component, margin adds space outside.
How do you make a component fill the entire screen in React Native?
flex: 1
Explain how you can nest a <TouchableHighlight> and a <View> to create a custom-styled button.
Wrap a styled <View> inside the <TouchableHighlight>
What is the purpose of JSX in React Native?
To define UI components using a syntax similar to HTML.
JSX allows developers to write UI components in a syntax similar to HTML, making the code more readable.