Direct dependency to React?
See original GitHub issueHi,
why did you added React and ReactDOM as a dependency to BackstopJS? Since that point I can’t use BackstopJS anymore because my project depends on React 16.1. and BackstopJS relies on React 15. When I run my tests with Jest they crash because of different versions of React. With BackstopJS 3.0.39
everything worked fine in the past.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Dependency injection in React - LogRocket Blog
Dependency injection (DI) is a pattern where components necessary for your code to run are hot-swappable. This means that your dependencies ...
Read more >Add a Dependency to React in package.json for a ... - Pluralsight
Developing apps in React involves external dependencies as reusable components published by other React developers that you can use in your ...
Read more >create-react-app dependency version issues with React 18
Go back to your root folder and run npx create-react-app my-app (your app name) --template file:PATH_TO_YOUR_CUSTOM_TEMPLATE.
Read more >Advanced Dependency Injection in React - Bits and Pieces
Dependency Injection with React · 1. Using props allows dependency injection. function welcome(props) { return <h1> Hello, {props.name}</h1>; } · 2.
Read more >React Has Built-In Dependency Injection - Marmelab
Dependency Injection is a popular pattern that many frameworks implement - but React.js, apparently, doesn't. It turns out React has a ...
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 FreeTop 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
Top GitHub Comments
Hi @mantovanig,
ok, cool. But why do you have a dependency to React in general? If you made it as a
peerDependency
you are assuming / forcing the consuming project to use React. What if you want to use BackstopJS but don’t have nothing to do with React? For example if your project uses Angular or Vue. These projects are now forced to install React just for BackstopJS? 🤔I think you would want all of the react / webpack code as a devDependencies sections. I think this would hold for any dependency that only applies to generating the compare/output code.
from the npm docs: https://docs.npmjs.com/files/package.json#devdependencies
It’s fine to have it as a dependency if it’s an application, but I think the trouble comes from using it as a Module especially with react.
fantastic library by the way.
I think this is the dependency structure you are looking for
https://github.com/garris/BackstopJS/pull/813