CodeMirror 6 works fine in React 18.3.1, but in React 16.14.0, features like syntax highlighting and autocomplete fail to work. Is this due to incompatibility with React 16?
No, it’s because your upgrade (probably with yarn) messed up your dependency tree and installed multiple copies of @codemirror packages. Clear your package lock and reinstall (or switch to a less buggy package manager like npm), and the problem should go away.
Following your instructions, I cleaned up the dependency tree again and the issue has been resolved. Thank you very much for your help.