Remove Platform.select()
(#3027)
This commit is contained in:
parent
442eb135ee
commit
7fd13cacfe
1 changed files with 13 additions and 13 deletions
|
@ -1,25 +1,25 @@
|
||||||
import {Platform} from 'react-native'
|
import {isAndroid, isIOS, isNative, isWeb} from 'platform/detection'
|
||||||
|
|
||||||
export function web(value: any) {
|
export function web(value: any) {
|
||||||
return Platform.select({
|
if (isWeb) {
|
||||||
web: value,
|
return value
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ios(value: any) {
|
export function ios(value: any) {
|
||||||
return Platform.select({
|
if (isIOS) {
|
||||||
ios: value,
|
return value
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function android(value: any) {
|
export function android(value: any) {
|
||||||
return Platform.select({
|
if (isAndroid) {
|
||||||
android: value,
|
return value
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function native(value: any) {
|
export function native(value: any) {
|
||||||
return Platform.select({
|
if (isNative) {
|
||||||
native: value,
|
return value
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue