reactjs / react-tutorial

Code from the React tutorial.
http://facebook.github.io/react/docs/tutorial.html
Other
3.29k stars 2.13k forks source link

Race condition in refresh code #130

Closed daxfohl closed 8 years ago

daxfohl commented 8 years ago

If you POST a new comment at the same time you poll, the optimistic GUI update occurs, then if the poll returns before the POST, it'll cause the comment on the GUI to disappear again until the POST returns. So you get a little flash before the comment appears permanently.

zpao commented 8 years ago

Thanks for noticing, you are now ready to go build your own version that handles that better 😀. This is not meant to be a production ready and resilient application, only an example for educative purposes. We wanted to focus on the React part as much as possible and not spend too much time making a big deal about the data fetching and server-side aspects.