yudielcurbelo/react-qr-scanner

Allow versions < React 18 as peer dependency

eimerreis opened this issue ยท 5 comments

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch @yudiel/react-qr-scanner@2.0.1 for the project I'm working on.

I am using this package in scope of a react 17 based project. From what I saw across the repo, the package does not actively use any React 18 features.

Couldn't we open the peer dependency version range to allow other versions than react 18?

Here is the diff that solved my problem:

diff --git a/node_modules/@yudiel/react-qr-scanner/package.json b/node_modules/@yudiel/react-qr-scanner/package.json
index c2c824d..f897269 100644
--- a/node_modules/@yudiel/react-qr-scanner/package.json
+++ b/node_modules/@yudiel/react-qr-scanner/package.json
@@ -55,7 +55,7 @@
     "typescript": "^5.4.5"
   },
   "peerDependencies": {
-    "react": "^18.2.0",
+    "react": "^17.0.0 || ^18.2.0",
     "react-dom": "^18.2.0"
   },
   "dependencies": {

This issue body was partially generated by patch-package.

Sorry, forgot to add react-dom as well

Could this work for you?

 "peerDependencies": {
    "react": "^17 || ^18",
    "react-dom": "^17 || ^18"
  }

yeah would work ๐Ÿ‘

Please try the new version.

@yudielcurbelo works! ๐Ÿ™‚ Big up for the superfast response & fix