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

Warn if ReactDOM.createPortal is inside a noscript or other text content tag #13985

Closed
bloodyowl opened this issue Oct 26, 2018 · 4 comments
Closed
Labels
Resolution: Stale Automatically closed due to inactivity Type: Enhancement

Comments

@bloodyowl
Copy link
Contributor

Do you want to request a feature or report a bug?
bug

What is the current behavior?

When calling ReactDOM.createPortal from within a <noscript />, nothing happens, no error is logged.

ReactDOM.render(
  <noscript>
    {ReactDOM.createPortal("yo", modalNode)}
  </noscript>,
  appNode
);

What is the expected behavior?

Whether:

  • warn that it doesn't work (it worked in the previous version)
  • render the portal

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

  • React 16.5.0 & more recent
  • Reproducible in every browser

Repro
https://jsfiddle.net/bloodyowl/n5u2wwjg/223296/

@bloodyowl
Copy link
Contributor Author

probably related to this change: #13537

@gaearon
Copy link
Collaborator

gaearon commented Nov 1, 2018

Seems super niche so I'm not sure we'd be adding a warning unless somebody sends a PR. You can render <Fragment><noscript>...</noscript>{portal}</Fragment> as a work around.

@gaearon gaearon changed the title ReactDOM.createPortal doesn't render if descendant of a noscript tag Warn if ReactDOM.createPortal is inside a noscript or other text content tag Nov 1, 2018
@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

stale bot commented Jan 19, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants