Skip to content

(un)mountComponent seems to behave improperly for the root component of the update #1567

Closed

Description

@syranide

Logging mountComponent and unmountComponent reveals:

MOUNT .0 (WrapperComponent)
MOUNT .0 (MockComponent)
MOUNT .0 (span)
UNMOUNT .0 (span)
UNMOUNT .0 (MockComponent)
MOUNT .0 (MockComponent)
MOUNT .0 (span) 

Which doesn't make sense (to me at least).

var container = document.createElement('div');

var MockComponent = React.createClass({
  render: function() {
    return <span />;
  }
});

var WrapperComponent = React.createClass({
  render: function() {
    return this.props.children || <MockComponent />;
  }
});

React.renderComponent(<WrapperComponent />, container);

React.renderComponent(
  <WrapperComponent><MockComponent /></WrapperComponent>,
  container
);

Activity

  1. sophiebits commented on May 19, 2014

    @sophiebits
    Collaborator

    Can you log the this.type.displayName too and something to distinguish the two renderComponent calls?

  2. syranide commented on May 19, 2014

    @syranide
    ContributorAuthor

    Updated, that makes more sense, so the ID being sent is wrong then.

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