react-avatar-editor
react-avatar-editor copied to clipboard
React 19 dependency
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:
Facing the same issue when trying to upgrade to React v19
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 Thanks. It works!
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>'.
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
Native support for React 19 would be most appreciated ;-)
@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
Great to have a v14 with react 19 support! Is there a changelog somewhere? I'm wondering if there are breaking changes.
Great to see this supported in v14, thank you. Is there a plan to make a non-beta release of v14? Any help needed?
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.
I'm working on adding some tests so we can do more refactorings without the risk of breaking it too bad.
@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
@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]
Thanks for the feedback, please try 14.0.0-beta.6
@DanielSchiavini please add the exact version to you package json (14.0.0-beta.6)
The changelog is still not visible in releases, but the installation seems to work fine now
@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
Great, thanks!
@DanielSchiavini @doberkofler does the latest beta work for you? feedback much apprechiated!
The installation works fine but something else in my app is going wrong on react 19, so I couldn't test it
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.
@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!
I've tested it. The getImage() method gives black image. The v13 works with overrides.
@mosch Would be great if the 14 production version could be be released ;-)
@doberkofler thanks for the ping, let me see...
@mosch is there any update to release the latest version that support the react18 and react 19. Thanks
@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"
}
}
@mosch Just a friendly reminder ;-)