Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

componentDidMount is not fired for portals #512

Open

Description

@1999

I'm having a very awkward issue at the moment: my render() function returns a portal:

render() {
    const {
      children,
      overrideStyle = {},
    } = this.props;

    const portal = (
      <PortalContainer>
        <Text innerRef={this.textRef}>
          <Overlay style={overrideStyle}>
            <OverlayContent>
              {children}
            </OverlayContent>
          </Overlay>
        </Text>
      </PortalContainer>
    );

    return createPortal(portal, this.domNode);
  }

But when the component is rendered for the first time "render" is called, but "componentDidMount" doesn't get executed. On the second render everything works fine and component actually renders and componentDidMount is fired. Is here anything I can help?

Activity

  1. developit commented on Dec 18, 2018

    @developit
    Member

    @1999 - componentDidMount of the parent component, or the child?

  2. 1999 commented on Dec 20, 2018

    @1999
    Author

    componentDidMount() of the component which has this render implementation that I described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions