wsmd / react-use-form-state

📄 React hook for managing forms and inputs state
http://react-use-form-state.now.sh
MIT License
936 stars 55 forks source link

Don't specify react versions #160

Open RichardLindhout opened 2 years ago

rijk commented 2 years ago

This fixes the following error when installing:

% npm i react-use-form-state
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my-project@0.1.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from react-use-form-state@0.13.2
npm ERR! node_modules/react-use-form-state
npm ERR!   react-use-form-state@"*" from the root project
rijk commented 2 years ago

Also reported in #158

rijk commented 1 year ago

Is there a way to apply this patch if this package is not updated? I tried using https://www.npmjs.com/package/patch-package but it runs after install so that doesn't work.

rijk commented 1 year ago

Found the answer: just add an overrides key to your package.json:

{
  "dependencies": {
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-use-form-state": "^0.13.2"
  },
  "overrides": {
    "react-use-form-state": {
      "react": "*",
      "react-dom": "*"
    }
  }
}
davidgs commented 10 months ago

Any hope of getting this fixed?