When i use semicolon in my jsx code:
render() {
var imageList = this.state.imagestore || [];
return (
<div className="main todos" ref="asdf">
<ul>
{imageList.map(function(item) {
return <li>{item.name}</li>; {/* The extra semicolon here. /}
})};
</ul>
</div>
);
}
But so strange, it print to my html page:
<ul data-reactid=".0.4">
<li data-reactid=".0.4.0:0">鍥剧墖1</li>
<li data-reactid=".0.4.0:1">鍥剧墖2</li>
<li data-reactid=".0.4.0:2">鍥剧墖3</li>
<span data-reactid=".0.4.1">;</span> <!-- The extra span here -->
</ul>
Could somebody tell me why ?
It's the semicolon in })}; that you don't want.
@spicyj Thank you!
Most helpful comment
It's the semicolon in
})};that you don't want.