unicef / material-ui-currency-textfield

Currency textfield for React Material UI
https://unicef.github.io/material-ui-currency-textfield/
117 stars 93 forks source link

Enable this to work with react v 17+ #76

Open cowley05 opened 1 year ago

cowley05 commented 1 year ago

When installing this dependency using react 17 an error is produced (as below). It would be great if this could work with versions later than 16.

npm install @unicef/material-ui-currency-textfield --save

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: MY_REPO
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@"^16.8.0 || ^17.0.0" from @material-ui/core@4.12.4
npm ERR!   node_modules/@material-ui/core
npm ERR!     peer @material-ui/core@">= 4.3.0" from @unicef/material-ui-currency-textfield@0.8.6
npm ERR!     node_modules/@unicef/material-ui-currency-textfield
npm ERR!       @unicef/material-ui-currency-textfield@"*" from the root project
npm ERR!   1 more (react-dom)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.6" from @unicef/material-ui-currency-textfield@0.8.6
npm ERR! node_modules/@unicef/material-ui-currency-textfield
npm ERR!   @unicef/material-ui-currency-textfield@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Alexie81 commented 1 year ago

yes, i have same error and i rlly need this. fix

IvarK commented 10 months ago

Posted this on the other issue as well:

Adding this to package.json works for me

"overrides": {
    "@unicef/material-ui-currency-textfield": {
      "react": "^17.0.0",
      "react-dom": "^17.0.0"
    }
  }