score:2

Accepted answer

Just adding that line will not get data from the server. You need to work all the way down to the end of the "Reactive State" section, creating the data file, and adding some ajax code to load the data.

score:0

You're sending data via props to CommentBox and checking for it in your CommentList component

score:4

You're sending data as a prop to CommentBox and trying to pass it on through CommentBox state.

<CommentList data={this.props.data} />

instead of

<CommentList data={this.state.data} />

I usually reason about props this way; Props are stuff coming in and State is stuff that's already in.


Related Query

More Query from same tag