react-native-zss-rich-text-editor icon indicating copy to clipboard operation
react-native-zss-rich-text-editor copied to clipboard

How to get HTML content

Open rasselll opened this issue 6 years ago • 2 comments

Hi noob question but how do i actually get the HTML content, i have an onPress, but when i try to alert out the content it just gives me the content from when the editor was initialised.

onPressLearnMore(){ alert(titleHtml + ' ' + contentHtml) }

rasselll avatar Jun 14 '18 13:06 rasselll

Hi,

Make a separate function for that say :

async getHTML() { const contentHtml = await this.richtext.getContentHtml(); return contentHtml }

Now invoke it on onPress.

jaspal-singh-gulati avatar Jun 20 '18 10:06 jaspal-singh-gulati

this.richtext.getContentHtml().then((htmlContent)=>{you can get it here})

ZengMX avatar Sep 20 '18 11:09 ZengMX