What is use of platform module in React Native?

prasanna chokkaku
prasanna chokkaku

Posted On: Feb 22, 2018

 

React Native Platform module is used to detect the platform of device in which the application is running. You can use the below code detect platform in React Native.

import {Platform, StyleSheet} from 'react-native';
const styles = StyleSheet.create({
  height: Platform.OS === 'ios' ? 200 : 100,
});

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    React Native Interview questions

    Explain What is React Native?

    React Native is a mobile app development platform that allows you to create android and ios apps only using Javascript. Re..

    React Native Interview questions

    Can we combine native ios or android code in React Native.

    Yes, we can. React Native smoothly combines the components written in Objective-C, Java, or Swift...

    React Native Interview questions

    Who uses React Native?

    Thousands of apps are created using React Native. Here is the list of some popular companies who are using React Native..