Answers for "react native detect platform"

1

react native get OS

const design = Platform.select({
    android: {
      header: true
    },
    ios: {
	  header: false
    },
  });
Posted by: Guest on May-10-2020
0

react native detect platform

Platform.select({
	ios: {
		backgroundColor: 'red',
	},
	android: {
		backgroundColor: 'blue',
	},
})
Posted by: Guest on March-06-2021
0

how to use platform.select

import {Platform} from 'react-native';
    st styles = StyleSheet.create({
      container: {
        flex: 1,
        ...Platform.select({
          ios: {
            backgroundColor: 'red',
          },
          android: {
            backgroundColor: 'blue',
          },
        }),
      },
    });
Posted by: Guest on October-13-2020

Code answers related to "react native detect platform"

Code answers related to "Javascript"

Browse Popular Code Answers by Language