I am attempting to integrate CKEditor into our React.js project, using the component found here: https://github.com/ckeditor/ckeditor5-react.
I have used this code in the git repository to define the CKEditor component:
https://github.com/ckeditor/ckeditor5-react/blob/master/src/ckeditor.jsx
And inside my code, I am referencing the component:
import CKEditor from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
const TemplateForm = props => {
return (
<div>
/* Other form fields */
<CKEditor
name="body"
placeholder="Compose message"
content={ props.defaults.body }
value={ props.defaults.body }
errors={ props.errors.body }
onInput={ props.onInput }
onChange={ props.onValueChange }
/>
</div>
);
};
When I load my page, I get a javascript error "Cannot read property 'create' of undefined" from ckeditor.js - the "this.props.editor" value is not defined. I'm a newbie to react, so I'm sure I'm just missing something pretty straightforward. Suggestions?