Question: 39
(Choose 1 answer)
Which of the following code snippets demonstrates how to conditionally render a component for Android
using the Platform module?
import React from 'react';
import { Platform, Text} from 'react-native';
export default function App() {
return (
<Text>
{Platform.OS === 'android' ? 'Hello Android': 'Hello iOS'}
</Text>
);
A. The code will display "Hello Android" only on iOS.
B. The code will display "Hello iOS" on both platforms.
C. The code will display "Hello Android" on Android and "Hello iOS" on iOS.
D. The code will crash on Android devices.