score:2
Apparently draft-js
does not have html output function because it's supposed to have no assumption on the output so people can tune their output however they want (see this). This means we'll have to implement it ourselves and if you're looking for just an html or markdown output to preserve in the database, then this mono repo can be of help. I've implemented an example of how to do it in this sandbox. Note that I used dangerouslySetInnerHTML
for demonstration which is not optimal. You may want to use sanitization and rich text components to display back the posts. As a matter of fact I'd suggest ditching html and going for markdown instead if possible.
Source: stackoverflow.com
Related Query
- draft.js - retrieve formatted text from db
- How retrieve text from draftjs
- how to retrieve text from google drive documents
- How to retrieve text from JSON and display the text in point form (ReactJS Hook)
- How to retrieve the text from a className in react
- ReactJS: get mediumtext from MySQL and view formatted text
- Retrieve data from a ReadableStream object?
- google material icons loading slowly, flicker from text to icon
- Create PDF file from HTML text React
- Retrieve Input value from Action onClick in SemanticUI
- Add text inside doughnut chart from chart js-2 in react
- Retrieve Custom Attribute from JavaScript (using Javascript Adapter) Keycloak
- How to get the selected text from text area in react?
- Draft JS recognize img from HTML
- Is it possible to display html formatted text in antd table?
- How to retrieve data from firebase in React?
- Unable to retrieve react-dom.development.js from unpkg
- Get text content from node in React
- How to retrieve the last added record from the database in the MERN technology stack?
- Retrieve current state from useReducer outside React component
- How to open a text file and read the contents from it on react native?
- Strip tag from text (in React JS)
- Retrieve file from firebase storage
- retrieve data from asyncStorage in react native
- react native Scroll View doesn't scroll from inside text input
- How to retrieve ref from hoc translated component by i18next
- Expect toContain text from a set of values in jest,enzyme with React
- How to render formatted text in ReactJS webapp?
- Fetch data using an id from an api but display an alternative text to address bar e.g. content_title in Next.js
- How to retrieve data from form using a POST route?
More Query from same tag
- Chrome extension: cannot use `document.querySelector().click()` after using `document.getSelection()`
- Why does React component keep logging console statement when not passed any props
- Transition page content excluding the header and footer
- i want the data that is in form component to be shown when pickup button is clicked
- useReducer state is apparently not reactive
- can't build test to useOnClickOutside custom hook
- Hamburger Transitions not working in react and onClick event too
- Chakra UI React _activeLink props not working
- All static assets coming back as "404 (Not found)" in Django/React app
- How to auto open react DatePicker
- how to provide own image to svg for background?
- How can I create a List of items from the API data I get?
- How to update React component when async prop promise resolves?
- Best way of sending request to child component
- How to sequentially call an async function in various time intervals and with different arguments
- Trying to get the data(of mongodb) to the client side for the specific field (data.site.alerts.alert)
- toggle div on and off produces random results
- Input field not binding with the state
- why first two item is not working in react?
- How to render React.js into HTML for portfolio
- export 'time' (imported as 'd3') was not found in 'd3'
- reactjs parent trigger child component
- What is the difference between handleChange vs OnChange in which is used in React?
- When to use React createFragment?
- curly braces in es6 arrow function for each
- Call a redux action in a function helper
- API array problems
- Sinon Spy + ReactJs property initializers syntax
- How do I use Component props in actionCreators.js?
- How can I get the object which has been changed and also the new changed value when Selecting options from the drop down