Try the below one. var {Platform} = React; if (Platform.OS === 'ios') return ( <Component1 /> ) else return ( <Component2 /> )