mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 17:53:59 +02:00
Fix performance issue with renderPlaceholder (#5339)
This commit is contained in:
@@ -129,6 +129,10 @@ export type EditableProps = {
|
||||
*/
|
||||
|
||||
export const Editable = (props: EditableProps) => {
|
||||
const defaultRenderPlaceholder = useCallback(
|
||||
(props: RenderPlaceholderProps) => <DefaultPlaceholder {...props} />,
|
||||
[]
|
||||
)
|
||||
const {
|
||||
autoFocus,
|
||||
decorate = defaultDecorate,
|
||||
@@ -137,7 +141,7 @@ export const Editable = (props: EditableProps) => {
|
||||
readOnly = false,
|
||||
renderElement,
|
||||
renderLeaf,
|
||||
renderPlaceholder = props => <DefaultPlaceholder {...props} />,
|
||||
renderPlaceholder = defaultRenderPlaceholder,
|
||||
scrollSelectionIntoView = defaultScrollSelectionIntoView,
|
||||
style: userStyle = {},
|
||||
as: Component = 'div',
|
||||
|
Reference in New Issue
Block a user