Due to business requirement, I need to include more than 30 Kendo Editor components in my React project, but the it is too slow to complete loading the page.
In my below testing code, it takes more than 10 seconds to load 50 empty Editors. I'm suspecting it is due to loading the the font icon of the toolbar of editor.
in Chrome dev tool, loading the embedded 'WebconponentsIcons.ttf' file takes 7 seconds. The font file is used to render the icons in toolbar of Editors as documented in https://docs.telerik.com/kendo-ui/styles-and-layout/icons-web
Searching in the forum, there is a similar thread on it for JQuery https://www.telerik.com/forums/editor-is-slow-with-toolbar-enabled. in test code of that thread https://dojo.telerik.com/aMUcArob/7, but the font file is get by separate HTTP request, rather than embedded in other resources.
Editor inline mode has the problem as well.
Any idea on how to resolve it?
Kendo UI version:
"@progress/kendo-editor-react-wrapper": "2018.2.620",
"@progress/kendo-theme-bootstrap": "^2.13.6",
"@progress/kendo-theme-default": "^2.54.0",
"@progress/kendo-ui": "2018.2.620",
RichTextEditor
import * as React from
'react'
;
import
'@progress/kendo-ui'
;
import { Editor } from
'@progress/kendo-editor-react-wrapper'
;
interface IProps {
onChanged?: Function;
// this function will be called when editor losing focus (on blur)
initialValue?: string;
// a html string, such as '<strong>Hello World!</strong>'
}
export class RichTextEditor extends React.Component<IProps> {
private initialValue: string;
constructor(props: IProps) {
super
(props);
this
.initialValue =
'This is a simple sample to show initial value in the rich text editor.'
}
public render() {
return
(
<div>
<Editor>
<textarea>
{
this
.initialValue}
</textarea>
</Editor>
</div >
);
}
}
App
class App extends React.Component<{}, {}> {
public render() {
return
(
<div>
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
<RichTextEditor />
</div>
);
}
}
ReactDOM.render(
<App />,
document.getElementById(
'react-app'
));