React Native Technology & Digital Applications 3 — Questions and Answers
Question 1: In React Native, what is the role of the Metro bundler?
- It transforms and bundles JavaScript source files for the app at development and build time (Correct answer)
- It compiles native Kotlin and Swift code into shared libraries
- It manages CocoaPods and Gradle dependencies
- It serves as the runtime engine executing JavaScript on the device
Correct answer: It transforms and bundles JavaScript source files for the app at development and build time
Metro is the JavaScript bundler used by React Native to resolve modules, transform code, and produce the JS bundle served to the app.
Question 2: What is the correct way to apply platform-specific code in React Native?
- Use Platform.OS or Platform.select(), or create files with .ios.js / .android.js extensions (Correct answer)
- Wrap code in try-catch blocks that catch platform errors
- Use environment variables set in .env files per platform
- Call NativeModules.getPlatform() at runtime
Correct answer: Use Platform.OS or Platform.select(), or create files with .ios.js / .android.js extensions
React Native offers Platform.OS checks, Platform.select(), and file extension–based splitting (.ios.js/.android.js) for platform-specific logic.
Question 3: Which prop on a FlatList improves scroll performance by recycling list item views?
- removeClippedSubviews (Correct answer)
- initialNumToRender
- maxToRenderPerBatch
- windowSize
Correct answer: removeClippedSubviews
removeClippedSubviews unmounts views that scroll off-screen, reducing the number of active native views and improving performance.
Question 4: What is the function of `react-native link` (or autolinking in RN 0.60+)?
- It connects native module code in third-party libraries to the iOS and Android build systems (Correct answer)
- It links JavaScript modules to their TypeScript type definitions
- It configures deep link URL schemes in the app manifest
- It syncs Gradle and CocoaPods lock files after npm install
Correct answer: It connects native module code in third-party libraries to the iOS and Android build systems
Autolinking (introduced in RN 0.60) automatically registers native modules from node_modules into the Xcode and Gradle build without manual configuration.
Question 5: Which built-in React Native component should you use to display images from both local and remote sources?
- Image (Correct answer)
- Picture
- Photo
- ImageView
Correct answer: Image
The Image component handles local (require()) and remote (uri) sources and provides props for resizeMode and caching behavior.
Question 6: What does the `StyleSheet.create()` method provide over plain JavaScript objects for styles?
- It validates style properties at development time and can optimize styles on the native side (Correct answer)
- It automatically applies vendor prefixes for CSS compatibility
- It merges styles with a global theme object automatically
- It converts styles to inline CSS for WebView rendering
Correct answer: It validates style properties at development time and can optimize styles on the native side
StyleSheet.create() validates style keys against React Native's supported properties in development and may improve performance by sending styles to the native layer as IDs.
Question 7: In React Native's new architecture, what replaces the asynchronous JavaScript Bridge?
- JSI (JavaScript Interface) (Correct answer)
- Fabric Renderer
- TurboModules
- CodeGen
Correct answer: JSI (JavaScript Interface)
JSI (JavaScript Interface) allows JavaScript to hold direct references to native objects and call native functions synchronously, eliminating bridge serialization overhead.
In React Native, what is the role of the Metro bundler?