# 플랫폼별 코드 (React Native) > Platform.OS, Platform.select, .ios.js/.android.js, 네이티브 API 접근 - 18 면접 질문 - Mid-Level - [면접 질문: React Native](https://sharpskill.dev/ko/technologies/react-native/interview-questions.md) ## 1. 애플리케이션이 iOS에서 실행되는지 Android에서 실행되는지 확인하려면 어떤 속성을 사용해야 합니까? **답변** Platform.OS는 현재 운영 체제를 나타내는 문자열을 반환합니다. iOS의 경우 'ios', Android의 경우 'android'입니다. 이 속성은 실행 중인 플랫폼을 확인하고 그에 따라 애플리케이션 동작을 조정하는 가장 직접적인 방법입니다. ## 2. 플랫폼에 따라 다른 스타일을 적용하기 위해 Platform.select를 사용하는 올바른 구문은 무엇입니까? **답변** Platform.select는 'ios', 'android' 및 선택적으로 'default' 키를 가진 객체를 받습니다. 이 방법을 사용하면 플랫폼별 값을 선언적이고 간결하게 정의할 수 있어 스타일과 설정에 특히 유용합니다. ## 3. 파일 확장자를 사용하여 iOS와 Android에 대해 서로 다른 구현을 가진 컴포넌트를 만들려면 어떻게 해야 합니까? **답변** React Native는 번들링 중에 .ios.js 및 .android.js 확장자를 가진 파일을 자동으로 감지합니다. Button.ios.js와 Button.android.js 같은 두 개의 파일을 만들면 'Button'을 임포트할 때 코드에 명시적인 조건 없이 플랫폼에 맞는 적절한 버전이 자동으로 로드됩니다. ## 15개 추가 질문 이용 가능 - 운영 체제 버전을 확인할 수 있는 Platform 속성은 무엇입니까? - Platform.select와 비교했을 때 파일 확장자(.ios.js/.android.js)를 사용하는 주요 장점은 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 React Native 면접 주제 - [JavaScript 핵심](https://sharpskill.dev/ko/technologies/react-native/interview-questions/javascript-essentials.md): 25개 질문, Junior - [React 기초](https://sharpskill.dev/ko/technologies/react-native/interview-questions/react-fundamentals.md): 20개 질문, Junior - [React Native 기초](https://sharpskill.dev/ko/technologies/react-native/interview-questions/react-native-basics.md): 22개 질문, Junior - [React Hooks](https://sharpskill.dev/ko/technologies/react-native/interview-questions/react-hooks.md): 20개 질문, Junior - [React 및 React Native를 위한 TypeScript](https://sharpskill.dev/ko/technologies/react-native/interview-questions/typescript-for-react-native.md): 22개 질문, Junior - [React Native 컴포넌트 및 API](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-components-api.md): 20개 질문, Junior - [React Native 스타일링 및 레이아웃](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-styling-layout.md): 18개 질문, Junior - [React Native 내비게이션](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-navigation.md): 22개 질문, Mid-Level - [React Native 상태 관리](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-state-management.md): 24개 질문, Mid-Level - [React Native 네트워킹 및 API](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-networking-api.md): 20개 질문, Mid-Level - [데이터 영속성](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-data-persistence.md): 20개 질문, Mid-Level - [폼과 유효성 검사](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-forms-validation.md): 18개 질문, Mid-Level - [React Native 애니메이션](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-animations.md): 22개 질문, Mid-Level - [Native Modules & Bridge](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-native-modules.md): 20개 질문, Mid-Level - [권한 및 디바이스 API](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-permissions-apis.md): 20개 질문, Mid-Level - [Push Notifications](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-push-notifications.md): 18개 질문, Mid-Level - [React Native 테스팅](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-testing.md): 20개 질문, Mid-Level - [React Native 디버깅](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-debugging.md): 18개 질문, Mid-Level - [Build & Deployment](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-build-deployment.md): 20개 질문, Mid-Level - [Expo vs React Native Bare](https://sharpskill.dev/ko/technologies/react-native/interview-questions/expo-vs-bare-rn.md): 18개 질문, Mid-Level - [성능 최적화](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-performance-optimization.md): 24개 질문, Senior - [메모리 관리](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-memory-management.md): 20개 질문, Senior - [Architecture Patterns](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-architecture-patterns.md): 22개 질문, Senior - [React Native New Architecture](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-new-architecture.md): 24개 질문, Senior - [보안 모범 사례](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-security-best-practices.md): 20개 질문, Senior - [Offline-First Architecture](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-offline-first.md): 20개 질문, Senior - [React Native CI/CD](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-ci-cd.md): 20개 질문, Senior - [Monorepo와 코드 공유](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-monorepo-architecture.md): 18개 질문, Senior - [고급 주제](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-advanced-topics.md): 22개 질문, Senior - [앱 라이프사이클 및 백그라운드 실행](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-app-lifecycle-background.md): 20개 질문, Mid-Level - [인증 및 세션 관리](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-auth-session-management.md): 22개 질문, Mid-Level - [Monitoring & Crash Reporting](https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-monitoring-crash-reporting.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/react-native/interview-questions/rn-platform-specific-code