Skip to content

react-addons-test-utils 15.4.0 now depends on react-dom instead of react #8314

@vvo

Description

@vvo

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
react-addons-test-utils 15.4.0 has a peer dependency on react-dom and uses it, 15.3.0 had a peer dependency on react.

In 15.3.0, react-addons-test-utils/index.js:

module.exports = require('react/lib/ReactTestUtils');

In 15.4.0, react-addons-test-utils/index.js:

module.exports = require('react-dom/lib/ReactTestUtils');

If your code contains:

import {isElement} from 'react-addons-test-utils';

It will fail given your current dependencies.

So if you did not have react-dom in your dependencies, because previously it was not needed, now it is and it will break your code.

Is this a breaking change?

This leads to errors like:

Module not found: Error: Can't resolve 'react-dom/lib/ReactTestUtils' or Cannot find module 'react-dom/lib/ReactTestUtils'

Current workaround

npm install react-dom --save[-dev]

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions