elgorditosalsero / react-gtm-hook

Easily manage the Google Tag Manager via Hook
https://elgorditosalsero-react-gtm-hook.netlify.app/
MIT License
220 stars 28 forks source link

Unable to install with NPM and react 17.0.2 #33

Closed scottandrew closed 3 years ago

scottandrew commented 3 years ago

Running npm with React 17.0.1 or above you get the following error.

Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!   peer react@">=17" from @elgorditosalsero/react-gtm-hook@2.0.7
npm ERR!   node_modules/@elgorditosalsero/react-gtm-hook
npm ERR!     @elgorditosalsero/react-gtm-hook@"2.0.7" from the root project
npm ERR!   29 more (@material-ui/core, react-dom, @material-ui/icons, ...)
elgorditosalsero commented 3 years ago

Hi, thx for the issue.

Can you provide more info?

I just bootstrapped an app with create-react-app and I successfully installed the package, both with yarn and npm.

The package.json bootstrapped + the lib:

  "name": "test",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@elgorditosalsero/react-gtm-hook": "^2.0.7",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Example of the running app with the lib: gtm

elgorditosalsero commented 3 years ago

Closing due to inactivity.