mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
parent
7280e2931e
commit
c7fd0f80af
5
.changeset/dry-cycles-sleep.md
Normal file
5
.changeset/dry-cycles-sleep.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/react": patch
|
||||
---
|
||||
|
||||
Updates the typings to `useEditor` and `EditorProvider` to not conflict with the core Editor type
|
@ -1,6 +1,7 @@
|
||||
import { Editor } from '@tiptap/core'
|
||||
import React, { createContext, ReactNode, useContext } from 'react'
|
||||
|
||||
import { Editor } from './Editor.js'
|
||||
import { Editor as ReactEditor } from './Editor.js'
|
||||
import { EditorContent } from './EditorContent.js'
|
||||
import { useEditor, UseEditorOptions } from './useEditor.js'
|
||||
|
||||
@ -44,7 +45,7 @@ export function EditorProvider({
|
||||
{slotBefore}
|
||||
<EditorConsumer>
|
||||
{({ editor: currentEditor }) => (
|
||||
<EditorContent editor={currentEditor} />
|
||||
<EditorContent editor={currentEditor as ReactEditor} />
|
||||
)}
|
||||
</EditorConsumer>
|
||||
{children}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { EditorOptions } from '@tiptap/core'
|
||||
import { type EditorOptions, Editor } from '@tiptap/core'
|
||||
import {
|
||||
DependencyList,
|
||||
MutableRefObject,
|
||||
@ -9,7 +9,6 @@ import {
|
||||
} from 'react'
|
||||
import { useSyncExternalStore } from 'use-sync-external-store/shim'
|
||||
|
||||
import { Editor } from './Editor.js'
|
||||
import { useEditorState } from './useEditorState.js'
|
||||
|
||||
const isDev = process.env.NODE_ENV !== 'production'
|
||||
|
@ -1,8 +1,7 @@
|
||||
import type { Editor } from '@tiptap/core'
|
||||
import { useDebugValue, useEffect, useState } from 'react'
|
||||
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector'
|
||||
|
||||
import type { Editor } from './Editor.js'
|
||||
|
||||
export type EditorStateSnapshot<TEditor extends Editor | null = Editor | null> = {
|
||||
editor: TEditor;
|
||||
transactionNumber: number;
|
||||
|
Loading…
Reference in New Issue
Block a user