How to use the react-rte.createValueFromString function in react-rte

To help you get started, we’ve selected a few react-rte examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsdrupal / drupal-admin-ui / packages / admin-ui / src / components / 02_atoms / Widgets / TextTextarea.js View on Github external
createValueFromString = props =>
    RichTextEditor.createValueFromString(
      // @todo This should not be needed after https://github.com/jsdrupal/drupal-admin-ui/issues/195
      (Array.isArray(props.value) &&
        props.value.length &&
        props.value[0].value) ||
        props.value.value ||
        '',
      'html',
    );
github KleeGroup / focus-components / src / components / input / rich-text / index.js View on Github external
buildValue(strValue, language) {
        return strValue ? RichTextEditor.createValueFromString(strValue, language) : RichTextEditor.createEmptyValue()
    }
github mizchi / next-editor / src / editors / WysiwygEditor.tsx View on Github external
constructor(props: any) {
    super(props)
    this.state = {
      value: RichTextEditor.createValueFromString(
        props.initialValue || "",
        "markdown"
      )
    }
  }
github tryanzu / frontend / src / board / components / publisher.js View on Github external
const [editor, setEditor] = useState(() => {
        return RichTextEditor.createValueFromString(markdown, 'markdown');
    });
github feature-flow / twotieredkanban / client / ui / project.jsx View on Github external
show() {
    const project = this.props.project;
    super.show({
      id: project.id,
      title: project.title,
      description:
      RichTextEditor.createValueFromString(project.description, 'html')
    });
  }
github JasonEtco / flintcms / app / components / Fields / RichText / index.js View on Github external
constructor (props) {
    super(props)
    if (props.defaultValue) {
      const value = RichTextEditor.createValueFromString(props.defaultValue, 'html')
      this.state = { value }
    } else {
      const value = RichTextEditor.createEmptyValue()
      this.state = { value }
    }

    this.focus = () => this[props.name].focus()
    this.onChange = (value) => {
      this.setState({ value })
      this.props.onChange(value.toString('html'))
    }
  }
github RxNT / react-jsonschema-form-extras / src / RTEField.js View on Github external
constructor(props) {
    super(props);

    let {
      formData = "",
      uiSchema: { rte: { format = DEFAULT_FORMAT } = {} },
    } = props;

    this.state = {
      value: RichTextEditor.createValueFromString(formData, format),
    };
  }

react-rte

React Rich Text Editor

ISC
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis