disqus-react

by disqus

A React component for Disqus

243 Stars 35 Forks Last release: about 2 months ago (v1.0.10) MIT License 130 Commits 6 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

disqus-react

npm version

A package for integrating Disqus services into React applications.

Installation

Using npm:

$ npm install --save disqus-react

Using yarn:

bash
$ yarn add disqus-react

Usage

DiscussionEmbed

This is the component that will load the main Disqus comments section.

import { DiscussionEmbed } from 'disqus-react';

This component is limited to one instance in the DOM at a time and will handle updates to both the

config
and
shortname
props and reload appropriately with the new discussion thread.

CommentCount

This component will display the comment count for the Disqus thread associated with the provided config.

import { CommentCount } from 'disqus-react';

<disqus.commentcount shortname="example" config="{" url: this.props.article.url identifier: this.props.article.id title: this.props.article.title> {/* Placeholder Text */} Comments </disqus.commentcount>

Multiple instances of this component can be included on the same page with different

config
variables (e.g. an article list showing the comment count for each). However, all threads on the site must be under the same primary site
shortname
. If the component receives a new
shortname
, all instances will be reset with counts for threads matching the updated site.

CommentEmbed

This component can be used to embed a Disqus comment into your page.

import { CommentEmbed } from 'disqus-react';

Multiple instances of this component may be include on the same page with different

commentId
variables and does not require that the embedded comment be under the same primary site
shortname
.

Contributing

If you'd like to contribute to this package feel free to submit a bug report, feature request, or pull request. Though we would ask that you first read through the contributing guidelines.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.