Skip to content

Commit c3b391a

Browse files
committed
refactor(webapp): type TipTap placeholder with PlaceholderRenderProps
Annotate the placeholder function using the extension’s exported props type instead of leaving parameters untyped or inferred indirectly Made-with: Cursor
1 parent 9365f06 commit c3b391a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/webapp/src/components/TipTap/TipTap.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from '@docs.plus/extension-hypermultimedia'
1111
import { Indent } from '@docs.plus/extension-indent'
1212
import { InlineCode } from '@docs.plus/extension-inline-code'
13-
import { Placeholder } from '@docs.plus/extension-placeholder'
13+
import { Placeholder, type PlaceholderRenderProps } from '@docs.plus/extension-placeholder'
1414
import type { HocuspocusProvider } from '@hocuspocus/provider'
1515
import { useStore } from '@stores'
1616
import { authStore } from '@stores'
@@ -219,7 +219,7 @@ const Editor = ({
219219
// @docs.plus/extension-placeholder uses state.init/apply with cursor-only
220220
// checks — O(1) for the common typing case. Critical for large collab docs.
221221
Placeholder.configure({
222-
placeholder: ({ node, pos, parentName }) => {
222+
placeholder: ({ node, pos, parentName }: PlaceholderRenderProps) => {
223223
if (node.type.name === 'heading' && pos === 0) return 'Enter document name'
224224
if (
225225
node.type.name === 'paragraph' &&

0 commit comments

Comments
 (0)