import * as React from 'react'; import JqxEditor, { IEditorProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxeditor'; class App extends React.PureComponent<{}, IEditorProps> { private myEditor = React.createRef(); constructor(props: {}) { super(props); const createCommand = (name: string): any => { switch (name) { case 'print': return { action: (widget: any, editor: any): void => { // return nothing and perform a custom action. this.myEditor.current!.print(); }, init: (widget: any): void => { widget.jqxButton({ height: 25, width: 40 }); widget.html('Print'); }, refresh: (widget: any, style: any): void => { // do something here when the selection is changed. }, tooltip: 'Print', type: 'button' } } } this.state = { createCommand, tools: 'bold italic underline | format font size | left center right | print' } } public render() { return ( <b>jqxEditor</b> is a HTML text editor designed to simplify web content creation. You can use it as a replacement of your Textarea or you can create it from a DIV element. <br /> <br /> Features include: <br /> <ul> <li>Text formatting</li> <li>Text alignment</li> <li>Hyperlink dialog</li> <li>Image dialog</li> <li>Bulleted list</li> <li>Numbered list</li> </ul> ); } } export default App;