A toolkit for building rich-text editors on the web
Footnotes
-
NYT 편집기 Oak 팀이 React 와 ProseMirror 를 붙이다 겪은 문제와 해법. React 는 render → commit 2단계, ProseMirror 는 동기로 한 번에 DOM 을 고치고 브라우저 편집을 읽어 들이는 양방향이라,
useLayoutEffect로view.updateState()하면 좌표가 낡고 state tearing 이 난다. 결국EditorView를 상속해setProps를 부수효과 없는pureSetProps와runPendingEffects로 쪼개고 렌더러를 React 로 다시 썼다 (@handlewithcare/react-prosemirror). ↩ -
Oak 팀 교육 자료. ProseMirror 를 Redux + React 에 대응시킨다 —
EditorView= store, transaction = action(대부분 ProseMirror 가 입력에서 만든다), plugin = reducer 확장·subscribe,dispatchTransaction= middleware, node spec 의toDOM= 컴포넌트(0이 children 자리). ↩