How to use the react-rte.createEmptyValue 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 dvaJi / ReaderFront / src / admin / blog / CreateOrEdit.js View on Github external
stub: '',
        status: 0,
        sticky: false,
        language: 0,
        thumbnail: ''
      },
      postStatus: Object.keys(params.blog.status).map(
        k => params.blog.status[k]
      ),
      blogCategories: Object.keys(params.blog.categories).map(
        k => params.blog.categories[k]
      ),
      languages: Object.keys(params.global.languages).map(
        k => params.global.languages[k]
      ),
      mdeState: RichTextEditor.createEmptyValue()
    };
  }
github joincivil / Civil / packages / components / src / UserStatement / RequestAppealStatement.tsx View on Github external
constructor(props: RequestAppealStatementProps) {
    super(props);
    this.state = {
      summaryValue: "",
      detailsValue: RichTextEditor.createEmptyValue(),
    };
  }
github dvaJi / ReaderFront / src / admin / blog / CreateOrEdit / Form.js View on Github external
function PostForm({ post, onSubmit }) {
  const [localPost, setLocalPost] = useState(post);
  const [mdeState, setMdeState] = useState(
    post.id > 0
      ? RichTextEditor.createValueFromString(post.content, 'markdown')
      : RichTextEditor.createEmptyValue()
  );
  const { formatMessage: f } = useIntl();

  const handleMdeChange = value => {
    let post = { ...localPost };
    post['content'] = value.toString('markdown');
    setLocalPost(post);
    setMdeState(value);
  };

  const handleOnChange = event => {
    let post = { ...localPost };
    post[event.target.name] = event.target.value;

    if (event.target.name === 'title') {
      post.stub = slugify(event.target.value);
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 feature-flow / twotieredkanban / client / ui / project.jsx View on Github external
show() {
    super.show({description: RichTextEditor.createEmptyValue()});
  }
github feature-flow / twotieredkanban / client / ui / tasks.jsx View on Github external
show() {
    super.show({
      title: '',
      description: RichTextEditor.createEmptyValue(),
      size: 1,
      blocked: ''
    });
  }
github joincivil / Civil / packages / components / src / RequestAppealModal.tsx View on Github external
constructor(props: RequestAppealModalProps) {
    super(props);
    this.state = {
      summaryValue: "",
      citeConstitutionValue: RichTextEditor.createEmptyValue(),
      detailsValue: RichTextEditor.createEmptyValue(),
    };
  }

react-rte

React Rich Text Editor

ISC
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis