Skip to content

Commit

Permalink
[lexical-react] Fix(lexical-react): ContentEditable props type rename (
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaaaaann authored Nov 18, 2024
1 parent e2396e4 commit ab758a7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/lexical-react/src/LexicalContentEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {forwardRef, Ref, useLayoutEffect, useState} from 'react';
import {ContentEditableElement} from './shared/LexicalContentEditableElement';
import {useCanShowPlaceholder} from './shared/useCanShowPlaceholder';

export type Props = Omit<ElementProps, 'editor'> &
export type ContentEditableProps = Omit<ElementProps, 'editor'> &
(
| {
'aria-placeholder'?: void;
Expand All @@ -29,10 +29,19 @@ export type Props = Omit<ElementProps, 'editor'> &
}
);

/**
* @deprecated This type has been renamed to `ContentEditableProps` to provide a clearer and more descriptive name.
* For backward compatibility, this type is still exported as `Props`, but it is recommended to migrate to using `ContentEditableProps` instead.
*
* @note This alias is maintained for compatibility purposes but may be removed in future versions.
* Please update your codebase to use `ContentEditableProps` to ensure long-term maintainability.
*/
export type Props = ContentEditableProps;

export const ContentEditable = forwardRef(ContentEditableImpl);

function ContentEditableImpl(
props: Props,
props: ContentEditableProps,
ref: Ref<HTMLDivElement>,
): JSX.Element {
const {placeholder, ...rest} = props;
Expand Down

0 comments on commit ab758a7

Please sign in to comment.