surevine / govuk-react-jsx

govuk-frontend compatible React components
https://govuk-react-jsx.netlify.app/
MIT License
3 stars 0 forks source link

React 18 support #145

Closed jpveooys closed 2 years ago

jpveooys commented 2 years ago

Hi,

govuk-react-jsx@7.0.1 has a peer dependency on "react": ">=16 <=17".

If React 18 works, it'd be good to get that updated to include version 18.

If React 18 doesn't work, it'd be good to get it supported.

Note that installing the package currently fails in a new project created with Create React App as recent versions of npm validate peer dependencies:

16:10 $ npm install govuk-react-jsx
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: govuk-react-jsx-playground@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=16 <=17" from govuk-react-jsx@7.0.1
npm ERR! node_modules/govuk-react-jsx
npm ERR!   govuk-react-jsx@"*" 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.
andymantell commented 2 years ago

Thanks for raising this. I'm actually away this week with no access to any computers (hooray!). I will deal with this for you as soon as I get back though, it shouldn't take a moment.

Hope that's ok. If it's urgent or holding you up, you are welcome to open a PR and I should be able to review and release it from here.

jpveooys commented 2 years ago

Hi,

No rush from me, thanks. I'm simply experimenting and can use React 17 for that.

Thanks

andymantell commented 2 years ago

This will go out with the next release of the library (Coming soon, since govuk-frontend just got updated)

andymantell commented 2 years ago

Just to let you know this has gone out with 7.1.0

I haven't had time to do the latest govuk-frontend update, but it was high time to release react 18 support, so here you go!