UNPKG

@wordpress/block-editor

Version:
27 lines (22 loc) 540 B
/** * WordPress dependencies */ import { forwardRef } from '@wordpress/element'; /** * Internal dependencies */ import RichText from '../rich-text'; const EditableText = forwardRef( ( props, ref ) => { return <RichText ref={ ref } { ...props } __unstableDisableFormats />; } ); EditableText.Content = function Content( { value = '', tagName: Tag = 'div', ...props } ) { return <Tag { ...props }>{ value }</Tag>; }; /** * Renders an editable text input in which text formatting is not allowed. */ export default EditableText;