Skip to content

Commit

Permalink
chore(@lexical/react): Refine useDecorators type (#5846)
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx authored Apr 16, 2024
1 parent aba3160 commit 6602ab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lexical-react/src/shared/useDecorators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*/

import type {LexicalEditor} from 'lexical';
import type {LexicalEditor, NodeKey} from 'lexical';

import {Suspense, useEffect, useMemo, useState} from 'react';
import * as React from 'react';
Expand All @@ -26,7 +26,7 @@ export function useDecorators(
editor: LexicalEditor,
ErrorBoundary: ErrorBoundaryType,
): Array<JSX.Element> {
const [decorators, setDecorators] = useState<Record<string, JSX.Element>>(
const [decorators, setDecorators] = useState<Record<NodeKey, JSX.Element>>(
() => editor.getDecorators<JSX.Element>(),
);

Expand Down

0 comments on commit 6602ab5

Please sign in to comment.