You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
I'm submitting this issue as a reference point for anyone else who may experience the same.
As a novice js programmer new to React I found the comment data array introduced in the Updating state section (see screenshot below) confusing at first. There is no text in the tutorial about where this data should be located. It seemed intuitive that I was supposed to include this data somewhere, but I couldn't tell where it should go (inside a React component? Independent from React components in the way that var data was introduced earlier in the tutorial? As a separate file?).
The answer is you don't do anything with the comment data array. The data is already found in the tutorial files as /comments.json. The json file was called into the system at an earlier step when you updated the ReactDOM.render to <CommentBox url="/api/comments" />,.
This is configured in the server file. If you're using the js server, this happens at:
Also, it appears that the tutorial didn't always work like this. You can read PR #79 for the history of the comments file being used in this way (current at least for the end of year 2015).