import React from 'react' ; import { EditorState } from '../../interfaces' ; import { useEditor } from '../useEditor' ; export function connectEditor < C > ( collect ? ) { return ( WrappedComponent ) => { return ( props ) => { const Editor = collect ? useEditor ( collect ) : useEditor ( ) ; return < WrappedComponent { ... Editor } { ... props } />; } ; } ; }