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

fix(Notification): Fixed exception when showing notifications #103

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

suevalov
Copy link
Contributor

@suevalov suevalov commented Feb 26, 2019

Purpose of PR

Fixes error happened when notification was showing before container is mounted in React Portal.

PR Checklist

  • I have read the relevant readme.md file(s)
  • All commits follow our Git commit message convention
  • Tests are added/updated/not required
  • Tests are passing
  • Storybook stories are added/updated/not required
  • Usage notes are added/updated/not required
  • Has been tested based on Contentful's browser support
  • Doesn't contain any sensitive information

Error happened when notification was showing before container is mounted in React Portal
const container = document.createElement('div');
document.body.appendChild(container);

render(<NotificationManager register={registerAPI} />, container);
render(<NotificationManager register={registerAPI} />, container, callback);
Copy link
Contributor

Choose a reason for hiding this comment

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

@suevalov
Could this also be wrapped in a Promise, like afterInit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is not exposed as external API and uses callback internally

@suevalov suevalov merged commit 18fddcc into master Feb 26, 2019
@suevalov suevalov deleted the fix-notifications branch February 26, 2019 11:00
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