formsy / formsy-react

A form input builder and validator for React JS
MIT License
763 stars 126 forks source link

Not working on latest React 18 version #684

Open elenaaleksovska-rldatix opened 2 years ago

elenaaleksovska-rldatix commented 2 years ago

Hello, I tried to upgrade to react 18.

These are the npm react packages that I am using: "react": "^18.2.0", "react-document-title": "^2.0.3", "react-dom": "^18.2.0", "react-router-dom": "^5.3.3", "react-select": "^5.4.0"

when I delete node_modules and run npm install these are the errors I get:

image

Any suggestions?

GhostyJade commented 2 years ago

Can you try to add to your package.json peer dependency section your react (and react-dom) current package and version? Something like

  "peerDependencies": {
    "react": "18.2.0",
    "react-dom": "18.2.0"
  }
elenaaleksovska-rldatix commented 2 years ago

I've tried, I got the same errors as in the screenshot.

GhostyJade commented 2 years ago

even in the resolutions object?


Da: Elena Aleksovska @.> Inviato: Thursday, September 15, 2022 9:29:31 PM A: formsy/formsy-react @.> Cc: GhostyJade @.>; Comment @.> Oggetto: Re: [formsy/formsy-react] Not working on latest React 18 version (Issue #684)

I've tried, I got the same errors as in the screenshot

— Reply to this email directly, view it on GitHubhttps://github.com/formsy/formsy-react/issues/684#issuecomment-1248522624, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJENIJTPUU5RBWEXXAZCYTLV6N2JXANCNFSM6AAAAAAQEZYV5Q. You are receiving this because you commented.Message ID: @.***>

AbdaliDahir commented 2 years ago

formsy accept only : ^16.0.0 || ^17.0.0 (check package). for now maybe u can use ==> npm config set legacy-peer-deps true. more information : https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh

felixmosh commented 2 years ago

Can you test v2.3.0 version which added React 18 as peerDeps

AbdaliDahir commented 2 years ago

@felixmosh Yup it works. tested with ( React 18.2.0 - node v16.17.0 - npm v8.15.0 - formsy v2.3.0).

felixmosh commented 2 years ago

Great, the installation is working. Can you check if there are any other issues?