-2

I am learning react.js. I am trying to develop an application where there is a feature like Facebook comment system.I would like to know "is Facebook comment coming from Database using AJAX request or it is placing text just from input box using React.js.

Before

enter image description here

After

enter image description here

Facebook comment reply is so fast. On the other hand in my application I can't make is fast like Facebook.

abu abu
  • 6,599
  • 19
  • 74
  • 131
  • 1
    You can give this a shot, could be helpful - https://pusher.com/tutorials/live-comments-javascript/ – Abrar May 20 '18 at 09:09

1 Answers1

1

Both. I think they are using optimistic UI update and at the same time update the database with ajax. Only when there is an error with request UI will show that this comment was not successfully committed.

Tomasz Mularczyk
  • 34,501
  • 19
  • 112
  • 166