slinky
slinky copied to clipboard
Support the magical 3rd argument for React createPortal
There is a hidden optional 3rd argument to createPortal Slinky forgot to include:
https://github.com/facebook/react/issues/12247#issuecomment-376840625
Totally undocumented and doesn't matter until you hit the edge case discussed in there :)
Should be:
@js.native
@JSImport("react-dom", JSImport.Namespace, "ReactDOM")
object ReactDOM extends js.Object {
def render(component: ReactElement, target: Element): ReactInstance = js.native
def hydrate(component: ReactElement, target: Element): ReactInstance = js.native
def findDOMNode(instance: React.Component): Element = js.native
def unmountComponentAtNode(container: Element): Unit = js.native
def createPortal(child: ReactElement, container: Element, key: js.UndefOr[String] = js.undefined): ReactElement = js.native
}