-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
ReactDOM.unstable_createPortal(<Component/>, target)
appends the rendered component in the target instead of replacing the contents of the target
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).
https://codesandbox.io/s/pjx8x9z2o7
What is the expected behavior?
It should replace the contents of the target with the new rendered component
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react@16.0.0-rc.3
react-dom@16.0.0-rc.3
Note: I might have completely misunderstood how portals work. @gaearon encouraged me to open this issue 😄