(editor: Editor, component: React.FC<T>, props: T = {} as T)
| 36 | getStore, |
| 37 | |
| 38 | mount<T extends SlotComponentProps>(editor: Editor, component: React.FC<T>, props: T = {} as T) { |
| 39 | const store = getStore(editor) |
| 40 | store.setState(state => { |
| 41 | const { components } = state |
| 42 | if (components.some(c => c.component === component)) return state |
| 43 | return { |
| 44 | components: [...components, { component, props } as SlotState<T>], |
| 45 | } |
| 46 | }) |
| 47 | }, |
| 48 | |
| 49 | unmount(editor: Editor, component: React.FC) { |
| 50 | const store = getStore(editor) |
nothing calls this directly
no test coverage detected