Tell us what’s happening:
Describe your issue in detail here.
Some example code is provided in explaining this exercise:
class Kitten extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<h1>Hi</h1>
);
}
}
Then they state, “This creates an ES6 class Kitten
which extends the React.Component
class.”
In the first exercise in this course it was stated that to “write JavaScript directly within JSX…you simply include the code you want to be treated as JavaScript within curly braces.”
Since the code above is not wrapped in curly braces, it is not JS, but must be JSX. So how can this be an ES6 class if it is not JS?
**Your code so far**
class MyComponent extends React.Component {
constructor(props) {
super(props);
}
render() {
// Change code below this line
return (
<div><h1>Hello React!</h1></div>
)
// Change code above this line
}
};
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Challenge: Create a React Component
Link to the challenge: