Monorepo & Code Sharing
Yarn workspaces, nx, shared packages, React Native Web, code reuse strategies
1What is a monorepo in the context of React Native development?
What is a monorepo in the context of React Native development?
Відповідь
A monorepo is an architecture where multiple projects or packages are stored in a single Git repository. In the React Native context, this enables code sharing between a mobile app, a web app (React Native Web), and utility packages. Benefits include centralized dependency management, atomic refactoring, and code consistency across platforms.
2What is the main role of Yarn workspaces in a React Native monorepo?
What is the main role of Yarn workspaces in a React Native monorepo?
Відповідь
Yarn workspaces enable managing multiple packages in a single repository with a single hoisted node_modules at the root. This reduces dependency duplication, enables automatic symlinking between local packages, and facilitates global scripts. In a React Native monorepo, this allows automatic linking of shared packages to both mobile and web applications.
3How to configure a basic monorepo with Yarn workspaces for React Native?
How to configure a basic monorepo with Yarn workspaces for React Native?
Відповідь
The basic configuration requires a root package.json with the workspaces field defining package patterns. Typically, packages/* or apps/* is used for applications and packages/* for shared libraries. The private field must be set to true to prevent accidental publication of the root package. Metro bundler also requires configuration to resolve symlinks properly.
What problem can dependency hoisting cause in a React Native monorepo?
What is Nx and what main advantage does it provide over Yarn workspaces alone?
+15 питань зі співбесід
Інші теми співбесід React Native
JavaScript Essentials
React Fundamentals
React Native Basics
React Hooks
TypeScript for React & React Native
React Native Components & API
React Native Styling & Layout
React Native Navigation
React Native State Management
React Native Networking & API
Data Persistence
Forms & Validation
React Native Animations
Native Modules & Bridge
Platform-Specific Code
Permissions & Device APIs
Push Notifications
React Native Testing
React Native Debugging
Build & Deployment
Expo vs React Native Bare
Performance Optimization
Memory Management
Architecture Patterns
React Native New Architecture
Security Best Practices
Offline-First Architecture
React Native CI/CD
Advanced Topics
App Lifecycle & Background Execution
Authentication & Session Management
Monitoring & Crash Reporting
Опануй React Native для наступної співбесіди
Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.
Почни безкоштовно