Skip to content

Referenced component after one Portal? #94

Open
@Wescoeur

Description

@Wescoeur

Hi, I have an issue with Portal, in some cases the container parameter used by the Portal component is one function with a reference which may be undefined. It's undefined if the referenced component is declared after a Portal.

You can see here the problem:
https://github.com/julien-f/issue-react-overlays-portal/blob/master/src/index.js

To build this example, clone the repo and use npm install && npm run build.
See the results in src/index.html.

I fixed the problem with this code:

componentDidMount () {
  this.forceUpdate()
}

But it's not a proper solution I think. Any ideas to fix this? Thx.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions