disqus / disqus-react

A React component for Disqus
MIT License
365 stars 46 forks source link

config is [object Object] when rendered to the DOM #89

Closed mikecann closed 3 years ago

mikecann commented 3 years ago

Describe the bug

It seems like the config object is being searialised into a HTML attribute

chrome_v8OB8T7XOi

Usage like:

<DiscussionEmbed
              shortname="devwbfg"
              config={{
                identifier: meta.oldUrl ?? slug,
                title: title,
              }}
            />

Example found: https://mikecann.co.uk/posts/the-cube

Any ideas?

tterb commented 3 years ago

@mikecann It looks like this is because we're currently spreading the props that are passed to the component to allow users to specify additional attributes (className, id, etc...). This shouldn't have any effect on the functionality, but it would probably be best to filter out the config object before passing it to the JSX element.

mikecann commented 3 years ago

Ah okay no worries :) Feel free to close this.