Skip to content

ReactTestUtils.isCompositeComponent (called by scry*) throws on stateless components #4882

@taion

Description

@taion

Example:

const Component1 = () => <div>Foo</div>;
class Component2 extends React.Component {
  render() {
    return (
        <div>Foo</div>
    );
  }
}
const instance = ReactTestUtils.renderIntoDocument(<Component1 />);

const div = ReactTestUtils.findRenderedDOMComponentWithTag(
  instance, 'DIV'
);
expect(div).to.exist;

This works with Component2 but not with Component1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions