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

Render an array of Components throws exception #1335

Closed
matma opened this issue Nov 8, 2017 · 1 comment
Closed

Render an array of Components throws exception #1335

matma opened this issue Nov 8, 2017 · 1 comment

Comments

@matma
Copy link

matma commented Nov 8, 2017

Hi,
One of the React 16 feature is possibility to render an array of components. Simple code like in this jsfiddle renders with no problem.

The same code under shallow (or any other type of rendering) will fail.

Code I use to test:

it('test', () => {
    const buttons = [
        <button key="A">A</button>,
        <button key="B">B</button>,
        <button key="C">C</button>,
    ];

    const wrapper = shallow(buttons);

    console.log(wrapper.debug());
});

It fails with such message:

Invariant Violation: ReactShallowRenderer render(): Invalid component element.
...
@ljharb
Copy link
Member

ljharb commented Nov 8, 2017

Duplicate of #1149.

@ljharb ljharb closed this as completed Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants