globocom / megadraft

Megadraft is a Rich Text editor built on top of Facebook's Draft.JS featuring a nice default base of components and extensibility

Home Page:http://megadraft.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support React v17

mottox2 opened this issue · comments

Expected Behavior

No error when I run npm install on a project that contains React17

Current Behavior

When I run npm install on a project that contains React17, I get the following error.

$ npm install megadraft
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: draft-editor@0.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.1.0" from megadraft@0.7.4
npm ERR! node_modules/megadraft
npm ERR!   megadraft@"*" 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.

I must run npm install megadraft --force

This error is caused by an outdated draft.js included in megadraft.
Latest draft.js support React17

Steps to Reproduce

  1. run npx create-react-app my-app
  2. run my-app
  3. run npm install megadraft

Browser, device, and OS

  • macOS 11.1
  • Node.js 15.5.1
  • npm 7.7.6
commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hi @mottox2. We did create a branch updating React to version 17. Enzyme does not have official support for it yet, only with a contributor adapter. Is there a specific reason for version 17 though? It seems to be only a transition version to React18, without any new features. Maybe version 16 would work just fine for your project.

Hello, @mottox2!
We have created a new release to fix the issue. You can just use the version 0.7.5. If you have any future problems, please contact us.
🤘