Question from the React Native (Legacy) test

Archived

For the following component, which modified version allows it to be used in a React Native project?

Example:
const MyComponent=()=>(
   <div>
        My Component
       <img src="https://facebook.github.io/react-native/img/header_logo.png"/>
   </div>
)

`` jsx
Code A:
import React from 'react'
const MyComponent=()=>(

<div> My Component <img src="https://facebook.github.io/react-native/img/header_logo.png"/> </div> )

Code B:
import React from 'react'
import{Div, Img} from 'react-native'
const MyComponent=()=>(

<Div> My Component <Img src="https://facebook.github.io/react-native/img/header_logo.png"/> </Div> )

Code C:
import React from 'react'
import{View, Image} from 'react-native'
const MyComponent=()=>(
<View>
My Component
<Source image={{uri:"https://facebook.github.io/react-native/img/header_logo.png"}}
</View>
)

Code D:
import React from 'react'
import{View, Text, Image} from 'react-native'
const MyComponent=()=>(
<View>
<Text>
My Component
</Text>
<Source image={{uri:"https://facebook.github.io/react-native/img/header_logo.png"}}/>
</View>
)

Author: Victor SabatierStatus: Archived(New question!)Question passed 123 times
-1
Community EvaluationsNo one has reviewed this question yet, be the first!