Question from the React Native (Legacy) test

Which of the following code snippets will print 'Hello World' to the console?

Easy

### Which syntax allows you to apply a style to a component?

Code A:
<MyComponent style="background-color: red">

Code B:
<MyComponent style={{"background-color": "red"}}>

Code C:
<MyComponent style={{backgroundColor: "red"}}>

Code D:
import {StyleSheet} from "react-native";
const styles = StyleSheet.create({
	backgroundColor: "red"
})
<MyComponent style={styles}>

Author: Victor SabatierStatus: PublishedQuestion passed 417 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!