Question from the React Native (Legacy) test

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;

Easy

Which of the following examples works to create a React Native component?

Code A:
import React from "react";
import {Text, View} from 'react-native';
class SomeComponent extends React.Component {
      render () {
            return (<View><Text>Some text</Text><View>);
      }
}
 
Code B:
import React from "react";
var SomeComponent = React.createClass(
      {displayName : "SomeComponent"},
      render: function() {
            var textElement = React.createElement(Text, null, "Some text");
            return React.createElement(View, null, textElement);
      }
);
 
Code C:
import React from "react";
var SomeComponent = () => {
      var textElement = "<span>Some text</span>";
      return ;
};
Author: Victor SabatierStatus: PublishedQuestion passed 500 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!