With FastComments, we can have as many comment widgets on the same page as we want. We can set them all to the same thread, and they will be kept in sync, or we can have them all be different threads at the same time. We can add, remove, and change the comment threads on-demand.
Dynamically Add and Swap Comment Threads
This is all done by configuring the urlId and related parameters and
calling update()
on the widget instances to swap them out with a different thread.
The below is an interactive example (hit run in the top left) which allows you to add and swap comment threads on demand.
We could remove them as well by calling instance.destroy
instead of update.
This is similar to how pagination works.
With the React and related libraries we can simply update the configuration and the library (React, Angular, Vue) will handle refreshing the widget for us. With VanillaJS we have to manage it ourselves as shown.
Feel free to ask any questions below and we'll do our best to help!