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=()=>(
Code B:
import React from 'react'
import{Div, Img} from 'react-native'
const MyComponent=()=>(
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>
)
-1
Community Evaluations
Iheb
11/01/2022
La correction est invalide car le reponse A et B est valide seulement en reactJS
on a pas de IMG et DIV en RN
Similar QuestionsMore questions about React Native
5
Write a React Native animation that spins an image.2
How to use StyleSheet in React Native1
What is the output of the following code?
const App = () => {
const [count, setCount] = useState(0);
return ({
<Text>
The count is {count}
</Text>
<Button onPress={() => setCount(count + 1)}>
Increase
</Button>
});
};
export default App;
1
Which of the following code snippets will print 'Hello World' to the console?1
I can launch the debugger in Chrome from my app, I run `react-native log-ios` from my command line