react-avatar-editor icon indicating copy to clipboard operation
react-avatar-editor copied to clipboard

React 19 dependency

Open daveycodez opened this issue 1 year ago • 24 comments

Hey having issues getting this library to work with React 19

npm error Could not resolve dependency:
npm error peer react@"^0.14.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error node_modules/react-avatar-editor
npm error   react-avatar-editor@"^13.0.2" from the root project

I guess I could fork but... D:

daveycodez avatar Dec 06 '24 22:12 daveycodez

Facing the same issue when trying to upgrade to React v19

moeabdol avatar Dec 11 '24 04:12 moeabdol

Facing the same issue when trying to upgrade to React v19

I added this to my package.json to fix it, seems to work for most libraries that don't support React 19.

"overrides": {
    "react-avatar-editor": {
      "react": ">=18.0.0",
      "react-dom": ">=18.0.0"
    }
}

daveycodez avatar Dec 11 '24 05:12 daveycodez

@daveycodez Thanks. It works!

moeabdol avatar Dec 11 '24 10:12 moeabdol

It doesn't seem to be working with typescript, even with the aforementioned solution.

I receive the error:

Its type 'typeof AvatarEditor' is not a valid JSX element type. Types of construct signatures are incompatible. Type 'new (props: AvatarEditorProps) => AvatarEditor' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'. Property 'refs' is missing in type 'AvatarEditor' but required in type 'Component<any, any, any>'.

eduardoliron avatar Dec 11 '24 15:12 eduardoliron

It doesn't seem to be working with typescript, even with the aforementioned solution.

I receive the error:

Its type 'typeof AvatarEditor' is not a valid JSX element type. Types of construct signatures are incompatible. Type 'new (props: AvatarEditorProps) => AvatarEditor' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component<any, any, any>'. Property 'refs' is missing in type 'AvatarEditor' but required in type 'Component<any, any, any>'.

Can you share your code? Looks like you are missing a "refs" property or something. Mine is working on TypeScript so maybe I can help

daveycodez avatar Dec 11 '24 22:12 daveycodez

Native support for React 19 would be most appreciated ;-)

doberkofler avatar Feb 09 '25 20:02 doberkofler

@doberkofler we should support React 19 – what issue do you see?

Please check out the 14.0.0 : https://www.npmjs.com/package/react-avatar-editor/v/14.0.0-beta.4

mosch avatar Feb 10 '25 08:02 mosch

Great to have a v14 with react 19 support! Is there a changelog somewhere? I'm wondering if there are breaking changes.

DanielSchiavini avatar Feb 10 '25 09:02 DanielSchiavini

Great to see this supported in v14, thank you. Is there a plan to make a non-beta release of v14? Any help needed?

carlbergman avatar Feb 10 '25 09:02 carlbergman

Find the changelog here it's on Github Releases.

We need feedback if the version is stable and working for everyone. It got a major version mainly because of larger refacorings / rewrite to typescript.

mosch avatar Feb 10 '25 11:02 mosch

I'm working on adding some tests so we can do more refactorings without the risk of breaking it too bad.

mosch avatar Feb 10 '25 11:02 mosch

@mosch I think the release is still in draft mode, I get a 404. Also, when trying to install this version, I'm still getting the following error:

npm error Found: [email protected]
npm error node_modules/react
npm error   react@"19.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^0.14.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm error node_modules/react-avatar-editor
npm error   react-avatar-editor@"^14.0.0-beta.5" from the root project

DanielSchiavini avatar Feb 10 '25 11:02 DanielSchiavini

@mosch Thank you for the feedback.

[email protected] still seems to peer depend on react < 19:

npm error Could not resolve dependency:
npm error peer react@"^0.14.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" from [email protected]

doberkofler avatar Feb 10 '25 11:02 doberkofler

Thanks for the feedback, please try 14.0.0-beta.6

mosch avatar Feb 10 '25 12:02 mosch

@DanielSchiavini please add the exact version to you package json (14.0.0-beta.6)

mosch avatar Feb 10 '25 12:02 mosch

@mosch

Thanks for the feedback, please try 14.0.0-beta.6

Seems to work as expected. Thank you!

doberkofler avatar Feb 10 '25 14:02 doberkofler

The changelog is still not visible in releases, but the installation seems to work fine now

DanielSchiavini avatar Feb 10 '25 15:02 DanielSchiavini

@DanielSchiavini

The changelog is still not visible in releases, but the installation seems to work fine now

Oops, you were right it was sitting in draft mode for a while. It's a pre-release now: https://github.com/mosch/react-avatar-editor/releases/tag/v14.0.0-beta.6

dan-lee avatar Feb 10 '25 15:02 dan-lee

Great, thanks!

DanielSchiavini avatar Feb 10 '25 15:02 DanielSchiavini

@DanielSchiavini @doberkofler does the latest beta work for you? feedback much apprechiated!

mosch avatar Feb 11 '25 10:02 mosch

The installation works fine but something else in my app is going wrong on react 19, so I couldn't test it

DanielSchiavini avatar Feb 11 '25 11:02 DanielSchiavini

We need feedback if the version is stable and working for everyone. It got a major version mainly because of larger refacorings / rewrite to typescript.

Other packages are blocking our upgrade to React 19, so I can't comment on whether 14.0.0-beta.6 is working with React 19 at the moment. However, I can say that it is working properly for us with React 18. If there are specific areas where feedback is needed, please let us know.

carlbergman avatar Feb 11 '25 15:02 carlbergman

@mosch

does the latest beta work for you? feedback much apprechiated!

As written yesterday: at least for me and with only limited testing 14.0.0-beta.6 works as expected.

Thank you!

doberkofler avatar Feb 11 '25 16:02 doberkofler

I've tested it. The getImage() method gives black image. The v13 works with overrides.

wallneradam avatar Apr 25 '25 23:04 wallneradam

@mosch Would be great if the 14 production version could be be released ;-)

doberkofler avatar Jul 11 '25 10:07 doberkofler

@doberkofler thanks for the ping, let me see...

mosch avatar Jul 11 '25 10:07 mosch

@mosch is there any update to release the latest version that support the react18 and react 19. Thanks

navichawla92 avatar Jul 16 '25 12:07 navichawla92

@mosch is there any update to release the latest version that support the react18 and react 19. Thanks

For me the v13 works with React 19 without any problems. The trick is to put this in your package.json:

"overrides": {
    "react-avatar-editor": {
      "react": ">=19.1.0",
      "react-dom": ">=19.1.0"
    }
}

wallneradam avatar Jul 16 '25 12:07 wallneradam

@doberkofler thanks for the ping, let me see...

@mosch Just a friendly reminder ;-)

doberkofler avatar Aug 23 '25 04:08 doberkofler

@mosch Just a friendly reminder ;-)

doberkofler avatar Oct 02 '25 06:10 doberkofler