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' ;
2
2
import { ICommand , defaultCommands } from '../../commands' ;
3
3
import { IMarkdownEditor , ToolBarProps } from '../..' ;
4
4
import './index.less' ;
@@ -54,16 +54,14 @@ export default function ToolBar(props: IToolBarProps) {
54
54
buttonProps [ key ] = btn [ key ] ;
55
55
} ) ;
56
56
} 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 > ;
67
65
}
68
66
return < button { ...buttonProps } key = { key } /> ;
69
67
} ) }
You can’t perform that action at this time.
0 commit comments