import { useState , SetStateAction , Dispatch } from 'react' ; import { EditorState } from 'prosemirror-state' ; type Config = Parameters < typeof EditorState . create > [ 0 ] ; export default function useProseMirror ( config ) { return useState ( ( ) => EditorState . create ( config ) ) ; }