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

Support the magical 3rd argument for React createPortal #568

Closed
evbo opened this issue Apr 27, 2022 · 0 comments · Fixed by #594
Closed

Support the magical 3rd argument for React createPortal #568

evbo opened this issue Apr 27, 2022 · 0 comments · Fixed by #594
Labels
Milestone

Comments

@evbo
Copy link

evbo commented Apr 27, 2022

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
}
@shadaj shadaj added the bug label Apr 30, 2022
@shadaj shadaj modified the milestones: v0.7.1, v0.7.3 Apr 30, 2022
shadaj added a commit that referenced this issue Sep 12, 2022
shadaj added a commit that referenced this issue Sep 12, 2022
shadaj added a commit that referenced this issue Sep 28, 2022
* Support the `key` parameter in `createPortal`

Fixes #568

* Run scalafmt

* No longer using Netlify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants