I use react-router-dom for routing in my React application. Part of my app extracted in another package. List of dependencies looks like this:
I had the same problem with my Create React App when running tests and I solved it by placing App.js instead of in Index.js as I have always done.
Before:
Index.js
ReactDOM.render(
,
document.getElementById('root')
);
App.js
return (
)
After:
Index.js:
ReactDOM.render(
,
document.getElementById('root')
);
App.js:
return (
)