
Q31
Q31 What could cause the "JSX expressions must have one parent element" error?
Using too many elements in JSX
Not wrapping JSX elements inside a parent element
Using JavaScript functions inside JSX
Not using semicolons properly
Q32
Q32 What is the preferred way to style components in React Native?
Using inline styles
Using external CSS files
Using the StyleSheet API
Using Bootstrap
Q33
Q33 What does Flexbox in React Native help with?
Handling animations
Managing UI layout and alignment
Writing JavaScript logic
Adding event handlers
Q34
Q34 What is the default flex direction in React Native?
row
column
row-reverse
column-reverse
Q35
Q35 Which of the following properties is used to create a responsive layout in React Native?
position
display
flex
overflow
Q36
Q36 What does justifyContent: 'center' do in React Native styling?
Aligns items horizontally in the center
Aligns items vertically in the center
Centers items inside a View
Removes extra spacing between elements
Q37
Q37 How do you apply multiple styles to a component in React Native?
Pass an array of style objects
Use multiple style attributes
Separate styles with commas
Use CSS classes
Q38
Q38 What is the correct way to define styles using StyleSheet.create?
StyleSheet.create({ myStyle: { color: 'blue' } })
StyleSheet({ myStyle: { color: 'blue' } })
Style.create({ myStyle: { color: 'blue' } })
new StyleSheet({ myStyle: { color: 'blue' } })
Q39
Q39 What will be the background color of a View with the following style:
{ backgroundColor: 'transparent' }?
White
Black
Transparent
Gray
Q40
Q40 What will happen if you set flex: 1 to a View inside a parent with flex: 1?
The child View will occupy the entire screen
The child View will be hidden
The child View will divide space equally with siblings
It will throw an error
Q41
Q41 Why is the error "StyleSheet.create is not a function" occurring?
Incorrect import of StyleSheet
StyleSheet is not supported in React Native
Incorrect function name
Styles must be defined inside the component
Q42
Q42 What could be the reason for styles not applying to a component?
Style object is not used
CSS classes are required
Only inline styles are supported
React Native does not support styling
Q43
Q43 Why does alignItems:
'center' not work as expected on a View?
alignItems does not exist in React Native
It only works if justifyContent is also used
It requires a parent with flex applied
It only works on Text components
Q44
Q44 What is the purpose of state in React Native?
To store local component data
To manage navigation
To handle API calls
To define styles
Q45
Q45 How is state defined in a functional component?
this.state
useState hook
setState
componentState
Q46
Q46 What is the key difference between state and props?
Props are mutable, but state is immutable
State is managed inside the component, while props are passed from a parent
Props can be changed inside the component
State and props are identical
Q47
Q47 What happens when state changes in a component?
Nothing happens
The component is re-rendered
State is reset to the initial value
The app crashes
Q48
Q48 Which of the following is correct about updating state in a class component?
State can be directly modified
State should be updated using this.setState
State updates immediately after calling setState
State updates are synchronous
Q49
Q49 What happens if you try to modify props inside a child component?
The component will update normally
Props will be updated automatically
React will throw an error
The update will be ignored
Q50
Q50 What is the correct syntax to define state in a functional component?
const [count, setCount] = useState(0);
this.state = { count: 0 };
useState({ count: 0 })
state = { count: 0 }
Q51
Q51 How do you pass a prop named title to a component named Header?
<Header title="Welcome" />
<Header props.title="Welcome" />
<Header {title} />
<Header @title="Welcome" />
Q52
Q52 What is the correct way to provide a default value for a prop in a functional component?
props.value = "Default"
const { value = "Default" } = props;
props.value || "Default"
Welcome.defaultProps = { value: "Default" };
Q53
Q53 Why does "Cannot read property 'setState' of undefined" occur in a class component?
setState is not a valid function
State cannot be modified
The component is not wrapped in a View
this is not bound in the constructor
Q54
Q54 What could cause a functional component to not update when state changes?
Not using setState
State updates synchronously
The component is inside a View
State can only be changed inside a class component
Q55
Q55 Why does a child component not receive updated props when the parent state changes?
The parent does not re-render
Props are immutable
Only class components support props
React Native does not support state updates
Q56
Q56 How do you handle user input in React Native?
Using event listeners
Using the onPress or onChangeText handlers
Using inline styles
Using Redux
Q57
Q57 Which method is used to handle button clicks in React Native?
onClick
onTap
onPress
onTouch
Q58
Q58 What event handler is used to capture text input changes in React Native?
onInput
onText
onChangeText
onModifyText
Q59
Q59 What is the correct way to prevent event propagation in React Native?
Calling event.preventDefault()
Calling event.stopPropagation()
Returning false
Using event.cancel
Q60
Q60 Which gesture handling library is commonly used in React Native?
React Navigation
React Gesture Handler
Redux
Context API

