Liam25
December 8, 2018, 1:10pm
1
Tell us what’s happening:
Hi, all searchs say that the code below is correct but it fails the test
ReactDOM.render(;, document.getElementById(“challenge-node”) )
Your code so far
class TypesOfFood extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div>
<h1>Types of Food:</h1>
{/* change code below this line */}
<Fruits />;
<Vegetables />
{/* change code above this line */}
</div>
);
}
}
// change code below this line
ReactDOM.render(<TypesOfFood />, document.getElementById("challenge-node"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
.
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
JSX tags should not have any trailing semicolons
Liam25
December 8, 2018, 1:36pm
3
Thanks joops75,
I removed the end semicolon but test still failed:
ReactDOM.render(, document.getElementById(“challenge-node”))
I don’t know where you’re getting ReactDOM.render(, document.getElementById(“challenge-node”))
from.
In your code you use ReactDOM.render(<TypesOfFood />, document.getElementById("challenge-node"));
which is correct. Then all you need to do is remove the trailing semicolon in your JSX and your solution passes.
Liam25
December 8, 2018, 2:36pm
5
Sorry, not sure why it pasted like that. It should read:
ReactDOM.render(, document.getElementById(“challenge-node”))
Liam25
December 8, 2018, 2:37pm
6
Did it again, leaves out for some reason
Liam25
December 8, 2018, 2:39pm
7
Not sure what’s happeneing.
I’m trying to post the last line of my code without the final semicolon which fails the test
The last line of your code is not JSX. The render
function returns JSX. The line I was referring to was <Fruits />;
sorinr
December 8, 2018, 3:31pm
9
Liam25:
<Fruits />;
See this quote. You must remove the semicolon
lasjorg
December 8, 2018, 6:07pm
10
When posting code use the correct formatting .
Anyway, as already answered, if you remove the semicolon after the <Fruits />
component you should pass.
1 Like