File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
core/src/components/ToolBar Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { Fragment } from 'react' ;
22import { ICommand , defaultCommands } from '../../commands' ;
33import { IMarkdownEditor , ToolBarProps } from '../..' ;
44import './index.less' ;
@@ -54,16 +54,14 @@ export default function ToolBar(props: IToolBarProps) {
5454 buttonProps [ key ] = btn [ key ] ;
5555 } ) ;
5656 } else if ( typeof obj . button === 'function' ) {
57- return React . cloneElement (
58- obj . button ( obj , editorProps , {
59- preview,
60- container,
61- containerEditor,
62- editor,
63- editorProps,
64- } ) ,
65- { key } ,
66- ) ;
57+ const CustomButton = obj . button ( obj , editorProps , {
58+ preview,
59+ container,
60+ containerEditor,
61+ editor,
62+ editorProps,
63+ } ) ;
64+ return < Fragment key = { key } > { CustomButton } </ Fragment > ;
6765 }
6866 return < button { ...buttonProps } key = { key } /> ;
6967 } ) }
You can’t perform that action at this time.
0 commit comments