question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:28
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
chaintngcommented, Nov 18, 2016

A work around to make CI work, make sure that your app contains follow dependencies all in the same version in package.json

  • react-addons-test-utils
  • react
  • react-dom
14reactions
vvocommented, Nov 17, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found