shadaj/slinky

Support the magical 3rd argument for React createPortal

evbo opened this issue · 0 comments

evbo commented

There is a hidden optional 3rd argument to createPortal Slinky forgot to include:

facebook/react#12247 (comment)

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
}