Function: DiffSourceToggleWrapper()

DiffSourceToggleWrapper(props): ReactNode | Promise<ReactNode>

A wrapper element for the toolbar contents that lets the user toggle between rich text, diff and source mode. Put the rich text toolbar contents as children of this component. For this component to work, you must include the diffSourcePlugin.

Parameters

ParameterType
propsobject
props.SourceToolbar?ReactNode
props.childrenReactNode
props.options?ViewMode[]

Returns

ReactNode | Promise<ReactNode>

Example

 <MDXEditor markdown='Hello world'
   plugins={[toolbarPlugin({
     toolbarContents: () => ( <> <DiffSourceToggleWrapper><UndoRedo /><BoldItalicUnderlineToggles /></DiffSourceToggleWrapper></>)
   }), diffSourcePlugin()]}
 />