'CKEditor error: Attempted import error: 'ckeditor4-react' does not contain a default export (imported as 'CKEditor')
I am trying to use the CKEditor in my react app. I don't know why this error is occurring.
This is how I've imported the CKEditor:
import CKEditor from 'ckeditor4-react';
This is how I've used it:
<CKEditor
onChange={evt => console.log( evt )}
/>
This is the error I keep getting:
Attempted import error: 'ckeditor4-react' does not contain a default export (imported as 'CKEditor').
Solution 1:[1]
In case anyone else is having this issue - for us it was because with ckeditor4-react < 2.0.0, there was no native TypeScript support, so we introduced our own index.d.ts types file. After upgrading however, our file was no longer compatible. We simply removed our index.d.ts types file, updated some of the props (e.g. we were using data instead of initData) and everything worked after that.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Erebus |
