react-addons-test-utils 15.4.0 now depends on react-dom instead of react
See original GitHub issueDo 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]
Issue Analytics
- State:
- Created 7 years ago
- Reactions:28
- Comments:9 (3 by maintainers)
Top Results From Across the Web
React v15.4.0 – React Blog
In React 15.4.0, we are finally moving React DOM implementation to the React DOM package. The React package will now contain only the ......
Read more >react-addons-test-utils | Yarn - Package Manager
This package is deprecated as of version 15.5.0: TestUtils have been moved to react-dom/test-utils; Shallow renderer has been moved to ...
Read more >ReactDOM.render is no longer supported in React 18 - Stack ...
import React from "react"; import ReactDOM from ... Instead of: ... Depending on your IDE your snippets may be called differently, ...
Read more >react-dom - npm
React package for working with the DOM.. Latest version: 18.2.0, last published: 6 months ago. Start using react-dom in your project by ...
Read more >Managing DOM components with ReactDOM - LogRocket Blog
import ReactDOM from 'react-dom';. Before we go into the details of ReactDOM's methods, let's first understand why we need ReactDOM instead of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A work around to make CI work, make sure that your app contains follow dependencies all in the same version in
package.json
I think we have all various experiences with this bug, let’s keep it constructive and see if we can do something about it so that we focus on positive not negative comments.