0
0
React Nativemobile~20 mins

Linking native libraries in React Native - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Native Linking Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens when you run react-native link?
In React Native, what is the main effect of running the command react-native link in your project folder?
AIt removes all linked native libraries from the project.
BIt installs JavaScript dependencies from npm without touching native code.
CIt builds the app and runs it on the connected device or emulator.
DIt automatically connects native libraries to your project by updating native files and configurations.
Attempts:
2 left
💡 Hint
Think about how native code and JavaScript code are connected in React Native.
ui_behavior
intermediate
2:00remaining
Effect of missing native linking on app UI
You installed a native library that provides a custom UI component. You forgot to link it natively. What will happen when you try to use that component in your React Native app?
AThe component will render as a simple default React Native View.
BThe component will work normally without any issues.
CThe app will crash or show an error because the native code is missing.
DThe app will ignore the component and skip rendering it silently.
Attempts:
2 left
💡 Hint
Native UI components need native code to work properly.
lifecycle
advanced
2:00remaining
When to run react-native link in app development?
At which point in your React Native app development should you run react-native link for a new native library?
ARight after installing the library with npm or yarn, before running the app.
BOnly after the app crashes due to missing native code.
CIt is never necessary to run it manually; React Native does it automatically.
DAfter building the app for production only.
Attempts:
2 left
💡 Hint
Think about when native code needs to be connected to your project.
navigation
advanced
2:00remaining
Linking native libraries and navigation behavior
You linked a native library that provides enhanced navigation gestures. After linking, what must you do to ensure the gestures work correctly in your React Native app?
AJust reload the JavaScript bundle; no rebuild needed.
BRebuild and restart the app so native changes take effect.
CClear app cache only; no rebuild or restart needed.
DUninstall and reinstall the app without rebuilding.
Attempts:
2 left
💡 Hint
Native code changes require a full rebuild to apply.
🔧 Debug
expert
3:00remaining
Diagnosing linking failure in React Native Android app
After linking a native library, your Android React Native app crashes on startup with a java.lang.UnsatisfiedLinkError. What is the most likely cause?
AThe native library's .so files were not included in the Android build.
BThe JavaScript code has a syntax error unrelated to native code.
CThe app's package.json is missing the linked library entry.
DThe AndroidManifest.xml file is missing internet permission.
Attempts:
2 left
💡 Hint
UnsatisfiedLinkError means native code is missing at runtime.