React Native

Platform-Specific Code

Platform.OS, Platform.select, .ios.js/.android.js, native APIs access

18 питань зі співбесід·
Mid-Level
1

Which property should be used to determine if the application is running on iOS or Android?

Відповідь

Platform.OS returns a string indicating the current operating system: 'ios' for iOS and 'android' for Android. This property is the most direct method to check the running platform and adapt the application behavior accordingly.

2

What is the correct syntax to use Platform.select to apply different styles based on the platform?

Відповідь

Platform.select accepts an object with 'ios', 'android' and optionally 'default' keys. This method allows defining platform-specific values in a declarative and concise way, which is particularly useful for styles and configurations.

3

How to create a component with different implementations for iOS and Android using file extensions?

Відповідь

React Native automatically detects files with .ios.js and .android.js extensions during bundling. By creating two files like Button.ios.js and Button.android.js, importing 'Button' will automatically load the appropriate version based on the platform, without explicit conditions in the code.

4

Which Platform property allows checking the operating system version?

5

What is the main advantage of using file extensions (.ios.js/.android.js) compared to Platform.select?

+15 питань зі співбесід

Інші теми співбесід React Native

JavaScript Essentials

Junior
25 запитань

React Fundamentals

Junior
20 запитань

React Native Basics

Junior
22 запитань

React Hooks

Junior
20 запитань

TypeScript for React & React Native

Junior
22 запитань

React Native Components & API

Junior
20 запитань

React Native Styling & Layout

Junior
18 запитань

React Native Navigation

Mid-Level
22 запитань

React Native State Management

Mid-Level
24 запитань

React Native Networking & API

Mid-Level
20 запитань

Data Persistence

Mid-Level
20 запитань

Forms & Validation

Mid-Level
18 запитань

React Native Animations

Mid-Level
22 запитань

Native Modules & Bridge

Mid-Level
20 запитань

Permissions & Device APIs

Mid-Level
20 запитань

Push Notifications

Mid-Level
18 запитань

React Native Testing

Mid-Level
20 запитань

React Native Debugging

Mid-Level
18 запитань

Build & Deployment

Mid-Level
20 запитань

Expo vs React Native Bare

Mid-Level
18 запитань

Performance Optimization

Senior
24 запитань

Memory Management

Senior
20 запитань

Architecture Patterns

Senior
22 запитань

React Native New Architecture

Senior
24 запитань

Security Best Practices

Senior
20 запитань

Offline-First Architecture

Senior
20 запитань

React Native CI/CD

Senior
20 запитань

Monorepo & Code Sharing

Senior
18 запитань

Advanced Topics

Senior
22 запитань

App Lifecycle & Background Execution

Mid-Level
20 запитань

Authentication & Session Management

Mid-Level
22 запитань

Monitoring & Crash Reporting

Senior
20 запитань

Опануй React Native для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно