ReactJs How to set defaultstate with markdown value in draftjs reactjs default state value,reactjs default state,reactjs set default

How to set the defaultEditorState with a mark down value. I am using react-draft-wysiwyg. example.

const value = "Test Message :)↵↵Click This Link - link↵↵Link Url - link";

I have manage to set the defaultEditorState using the code below but its not rendering new line in this part "↵↵".

this.setState({
   editorState: EditorState.createWithContent(
     ContentState.createFromBlockArray(convertFromHTML(nextProps.value))
  )
});
Answer:1



  1. reactjs default state value
  2. reactjs default state
  3. reactjs set default state

import React, { Component } from 'react'; import { View, Text } from 'react-native'; import Firebase from 'firebase'; class App extends Component { render() { return ( <...

import React, { Component } from 'react'; import { View, Text } from 'react-native'; import Firebase from 'firebase'; class App extends Component { render() { return ( <...

I am trying to do something similar to this. However, I would like for the input field to stay in focus until the user clicks anywhere but within the menu or any of the submenus. I am trying to use ...

I am trying to do something similar to this. However, I would like for the input field to stay in focus until the user clicks anywhere but within the menu or any of the submenus. I am trying to use ...