Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass rest props to DiscussionEmbed component. #63

Merged
merged 1 commit into from
Mar 26, 2020
Merged

Pass rest props to DiscussionEmbed component. #63

merged 1 commit into from
Mar 26, 2020

Conversation

hsh2001
Copy link
Contributor

@hsh2001 hsh2001 commented Mar 24, 2020

Description

Pass rest props to DiscussionEmbed component.

Motivation and Context

Additional props can be added into DiscussionEmbed component. e.g.: props.children, props.className. but props.id will be ignored.

<Disqus.DiscussionEmbed 
  shortname="abc" 
  config={{}} 
  className="hello world" // added into div#disqus_thread tag.
  id="hmm..." // ignored.
>
  Loading... (Loading text, image or something else can be added!)
</Disqus.DiscussionEmbed>

How Has This Been Tested?

Not tested. However, there are no bug-prone changes and maybe there is no need for testing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • All new and existing tests passed.

@hsh2001 hsh2001 changed the title Update DiscussionEmbed.jsx Pass rest props to DiscussionEmbed component. Mar 24, 2020
Copy link
Contributor

@tterb tterb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsh2001 Thanks for the PR!
I tested this and can see a use-case for props.className, but it's worth noting that props.children will be ignored in this case along with anything else inside of #disqus_thread element.

@tterb tterb merged commit eebf8bf into disqus:master Mar 26, 2020
@hsh2001
Copy link
Contributor Author

hsh2001 commented Mar 26, 2020

Nice. Thank you 👍

But, Isn't there props.children contents before the script for the comment content is loaded? That's why I need these changes.

@tterb
Copy link
Contributor

tterb commented Mar 26, 2020

Yes, the props.children will exist in the element until the embed.js script is loaded, though the the script is loaded on componentDidMount so props.children will not usually be rendered.

@hsh2001
Copy link
Contributor Author

hsh2001 commented Mar 26, 2020

Good! I thought it would be nice if there is content that informs the user that embed.js is loading before it is loaded. Because DiscussionEmbeded component is just white space before the script is loaded and it is not good for UI & UX.

However, thank you for merge!

hsh2001 added a commit to pokeinfo/home that referenced this pull request Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants