My Top-3 React Native Interview Questions #reactnative #interviewquestions #coding #codingblog

preview_player
Показать описание
My Top-3 React Native Interview Questions 👇

1. New React Native Architecture — what changes it brings?
2. How can sensitive data be stored securely in React Native?
3. How does list work in React Native?
Рекомендации по теме
Комментарии
Автор

ChatGpt's answer for the first question:

The new React Native architecture, introduced with React Native version 0.69 and later, brings significant changes aimed at improving performance, developer experience, and extensibility. Here are the key changes:

### 1. **Fabric Renderer**
- **Introduction of Fabric:** Fabric is the new rendering system replacing the old one. It allows synchronous rendering, which makes the UI updates faster and more predictable. This change provides better support for concurrent React (e.g., concurrent mode, suspense) and allows better interoperation between JavaScript and native code.

### 2. **TurboModules**
- **Improved Module System:** TurboModules replace the old native module system, enabling faster communication between JavaScript and native code. With TurboModules, modules are loaded lazily, which can improve startup time by only loading the necessary modules.

### 3. **JSI (JavaScript Interface)**
- **Bridgeless Communication:** The old React Native architecture relied on a "bridge" to communicate between JavaScript and native code, which introduced overhead and potential performance bottlenecks. The new architecture uses JSI, which provides a more direct and efficient way for JavaScript to interact with native code, resulting in better performance.

### 4. **Codegen**
- **Automatic Type-Safe Bindings:** Codegen is a new tool that automatically generates type-safe bindings between JavaScript and native code. This helps in reducing manual errors and ensures that the JavaScript and native layers stay in sync, providing better type safety and improved reliability.

### 5. **Lean Core Initiative**
- **Modularization:** The Lean Core initiative is part of the new architecture's broader effort to reduce the core size of React Native by moving less commonly used modules to community-managed repositories. This modular approach helps in keeping the core smaller and more focused, improving maintainability and performance.

### 6. **Improved C++ Core**
- **Unified C++ Core:** The core of React Native has been rewritten in C++, making it easier to share code between platforms (iOS, Android, and others) and improving performance, especially in memory management and execution speed.

### 7. **Better Debugging and Developer Tools**
- **Enhanced Developer Experience:** The new architecture brings improvements to debugging tools and developer workflows, making it easier to diagnose issues, optimize performance, and iterate faster during development.

### 8. **Concurrent Mode Compatibility**
- **Future-Proofing:** The new architecture is built with React's future features in mind, such as concurrent mode, which allows React to break rendering work into chunks and spread it out over multiple frames, leading to a smoother user experience.

### Summary of Benefits:
- **Performance:** Faster and more efficient communication between JavaScript and native code, better memory management, and reduced UI thread contention.
- **Modularity:** More modular core, allowing developers to include only the modules they need.
- **Extensibility:** Easier to extend React Native with custom native modules using the new architecture.
- **Developer Experience:** Improved tools and workflows for debugging and building React Native apps.

The new architecture is a significant shift, and while it's still evolving, it aims to make React Native more robust, performant, and maintainable in the long term.

ysfengin