Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React CKEditor Custom build

/* 
You have to pass 3 steps:
1. copy the ckeditor5-custom build to root dir
	├── ckeditor5
	│   ├── build
	│   ├── sample
	│   ├── src
	│   ├── ...
	│   ├── package.json
	│   └── webpack.config.js
	├── node_modules
	├── public
	├── src
	├── ...
	└── package.json
2. run 'yarn add file ./ckeditor5'
3. use code below...
*/


import React, { Component } from 'react';
import Editor from 'ckeditor5-custom-build/build/ckeditor';
import { CKEditor } from '@ckeditor/ckeditor5-react'

const editorConfiguration = {
    toolbar: [ 'bold', 'italic' ]
};

class App extends Component {
    render() {
        return (
            <div className="App">
                <h2>Using CKEditor 5 from online builder in React</h2>
                <CKEditor
                    editor={ Editor }
                    config={ editorConfiguration }
                    data="<p>Hello from CKEditor 5!</p>"
                    onReady={ editor => {
                        // You can store the "editor" and use when it is needed.
                        console.log( 'Editor is ready to use!', editor );
                    } }
                    onChange={ ( event, editor ) => {
                        const data = editor.getData();
                        console.log( { event, editor, data } );
                    } }
                    onBlur={ ( event, editor ) => {
                        console.log( 'Blur.', editor );
                    } }
                    onFocus={ ( event, editor ) => {
                        console.log( 'Focus.', editor );
                    } }
                />
            </div>
        );
    }
}

export default App;
Comment

PREVIOUS NEXT
Code Example
Javascript :: authfunctions 
Javascript :: convert number to boolean javascript 
Javascript :: imdb-api 
Javascript :: javascript array push element at index 
Javascript :: regexp object js 
Javascript :: reset select form jquery 
Javascript :: js array return only certain positions 
Javascript :: datetime to date moment 
Javascript :: generate a random id 
Javascript :: react native button top right 
Javascript :: axios cancel previous request 
Javascript :: how to store array of object in local storage 
Javascript :: jquery on click outsile hide div 
Javascript :: javascript simulate click on element 
Javascript :: check template shopify 
Javascript :: javascript folder dynamic import 
Javascript :: remove local storage item 
Javascript :: make multiple function calls at the same time js async 
Javascript :: npm adm-zip 
Javascript :: toggle state react 
Javascript :: javascript date to firebase timestamp 
Javascript :: how to calculate the number of days between two dates in javascript 
Javascript :: react axios get cookie from response 
Javascript :: foreach loop javascript 
Javascript :: how to add up all the numbers in between 0 and that number 
Javascript :: url params vue 
Javascript :: [PrivateRoute] is not a <Route component. All component children of <Routes must be a <Route or <React.Fragment 
Javascript :: ajax syntax in javascript 
Javascript :: jquery addclass 
Javascript :: found page without a React Component as default export in 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =