import { Editor , Transforms } from 'slate' ; import { LogoElement } from '../custom-types' ; type Logo = Omit < LogoElement , 'type' | 'children' > ; export const insertLogo = ( editor , logo ) => { const iconElement = { type : 'logo' , children : [ { text : '' } ] , ... logo , } ; Transforms . insertNodes ( editor , iconElement ) ; Transforms . move ( editor ) ; } ;