mikefey / react-responsive-image

🖼️ A React responsive image component.
36 stars 6 forks source link

React should be a devDependency, causes conflicts with other loaded React if used in project. #6

Open lord0gnome opened 6 years ago

lord0gnome commented 6 years ago

I'm a noob so let me know if I'm full of crap!

mikefey commented 6 years ago

I haven't run into this issue, can you provide some more context with how you're using it/what error(s) you're getting?

lord0gnome commented 6 years ago

I'll try to get a "minimum reproduce" thing going today!

lord0gnome commented 6 years ago

https://github.com/lord0gnome/test_react_responsive_image readme: Clone repo run npm install run npm start will give you errors about refs, when I look on react doc the likely culprit seems to me to be multiple copies of react, which you can see when you run "npm run ls-react" which uses npm ls react, and finds multiple versions, the one I'm using, and yours. when I run npm ls react

Now that I think about it, it could be because you're using react 15 and not 16? Is that possible?

waheedahmed commented 5 years ago

I'm also encountering this issue after updating react version to >= 16.0.0:

+-- @edx/cookie-policy-banner@1.1.10
| `-- @edx/paragon@2.7.0
|   `-- react@16.4.2 
+-- UNMET DEPENDENCY react@16.0.0
`-- react-responsive-image@4.0.0
  `-- react@15.6.2 

@mikefey Any update?

Thanks!

mikefey commented 5 years ago

@lord0gnome @waheedahmed This issue should be fixed in the latest release (v5.0.0), let me know if you still run into trouble though.