I've followed the CKEditor 4 documentation on creating a basic plugin, but it doesn't seem to register in my react app. I've added the plugin file structure and added the plugin.js in node modules along with the icons. How do I pass it to config in ckeditor4-react?
import logo from './logo.svg';
import './App.css';
import CKEditor from 'ckeditor4-react';
function App() {
return (
<div className="App">
<header className="App-header">
<h2>Using CKEditor 4 in React</h2>
<CKEditor
config={{
extraPlugins: "timestamp"
}}
data="<p>Hello from CKEditor 4!</p>"
/>
in plugin.js (node_modules/ckeditor4-react/plugins/timestamp/plugin.js
CKEDITOR.plugins.add( 'timestamp', {
icons: 'timestamp',
init: function( editor ) {
editor.addCommand( 'insertTimestamp', {
exec: function( editor ) {
var now = new Date();
editor.insertHtml( 'The current date and time is: <em>' + now.toString() + '</em>' );
}
});
editor.ui.addButton( 'Timestamp', {
label: 'Insert Timestamp',
command: 'insertTimestamp',
toolbar: 'insert'
});
}
});