I want to render html elements if the data is loaded.
render() {
return (
<div>
...
{ this.state.isLoaded ?
(
<ReviewShortIntro review={this.state.mainReview} />
<div className="clear" />
<div className="section-title"></div>
<ReviewList reviews={this.state.reviews} />
)
}
</div>
);
But this shows an error as below.
SyntaxError: this is a reserved word (60:35)
The 60th line is
<ReviewShortIntro review={{this.state.mainReview}} />
Without conditional flag (in the code, this.state.isLoaded), i have to check all properties of review is undefined or not.
I am not familiar with react.
What is my best way for resolve problem?