Bug with Variable Attributes in JSX .7?

Typing in this code:

var React = require('react');
var ReactDOM = require('react-dom');

var goose = 'https://s3.amazonaws.com/codecademy-content/courses/React/react_photo-goose.jpg';

// Declare new variable here:
var gooseImg = (
    alt="Goose" />

); */

yet getting this error message:

“gooseImg should be equal to an element.”

Any help appreciated…

id do it on one line without the () and idk why you have alt attribute there.

i would guess it’s not picking up that its an html element because of the ( )

1 Like

Thanks removed the (…) parentheses worked but I can’t help but think

Were we not taught JSX items are within (…)?

1 Like

I believe it is because ( ) is used for multi-line expressions (check that, but it had something to do with multi-line. I don’t think you use () for the html elements that it was expecting in this exercise.

Get rid of the ‘alt=“Goose”’ as well as the parenthesis w/ semi-colon

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.