Explore Library
React NativePlatform-Specific Code

43 items

1

Comparing Platform.Version on Android

Code Quiz
2

Ternary Platform Check Gone Wrong

Code Quiz
3

StatusBar backgroundColor Does Nothing on iOS

Code Quiz
4

Default Case in Platform.select

Code Quiz
5

Platform-Specific File Extensions

Code Quiz
6

Platform.select in StyleSheet.create

Code Quiz
7

Platform.OS Runtime Branching

Code Quiz
8

Platform.select Value Mapping

Code Quiz
9

Detecting Web vs Native

Code Quiz
10

Extension Resolution Order

Code Quiz
11

Platform.isPad Constant

Code Quiz
12

Platform-Specific Style Objects

Code Quiz
13

Branch Code vs Split Files

Slides / Video
14

Platform Behavior in Shared Components

Slides / Video
15

Organizing Platform-Specific Code

Slides / Video
16

Detecting Platform Constants: isPad & isTV

Slides / Video
17

Conditional Styling per Platform

Slides / Video
18

Native File Extensions for Web Sharing

Slides / Video
19

Platform.Version for OS Checks

Quiz
20

Shared vs Platform-Divergent Code

Quiz
21

Platform.select for Value Maps

Quiz
22

Reading Platform.constants

Quiz
23

Platform-Specific File Extensions

Quiz
24

Platform Differences: elevation vs shadow

Quiz
25

Detecting Tablet with Platform.isPad

Quiz
26

Platform.select in StyleSheet

Quiz
27

.native.js vs .web.js Resolution

Quiz
28

Conditional Rendering per Platform

Quiz
29

How Metro Resolves Platform Extensions

Quiz
30

Automatic Platform Extension Resolution

Flashcard
31

Platform-Specific File Extensions

Flashcard
32

Platform.Version for OS Version Checks

Flashcard
33

Physical Device vs Simulator

Flashcard
34

Conditional Platform Component Rendering

Flashcard
35

Platform.isPad, isTV Constants

Flashcard
36

StatusBar and Safe Area Differences

Flashcard
37

.native.js for Web Code Sharing

Flashcard
38

Organizing Platform-Specific Code

Flashcard
39

Platform.select for OS Value Maps

Flashcard
40

Platform-Specific Styling Differences

Flashcard
41

Platform File Extensions in React Native

Slides / Video
42

Platform.Version for OS Version Checks

Slides / Video
43

Platform.select for Per-Platform Values

Slides / Video
FlashcardIntermediate

Platform.select for OS Value Maps

Platform.select returns a value based on the current operating system from a supplied map.

Question

What does Platform.select do and when would you use it?

Click to reveal answer