You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the React version of the Froala Editor in my application. Since this will be used in several CRUD operations, I decided to create a component to be used in all my create and update pages.
Everything works great when creating an article, however when I try to fetch a text field from MongoDB in the update pages, the HTML does not gets to render.
As briefly stated above, the string coming from the DB contains html tags:
<h1>Yada-yada-yada</h1><p>I'm coming from the MongoDB object</p>
The <MyTextArea /> is the component that I created where the Froala Editor is initialized:
"use client";importFroalaEditorComponentfrom"react-froala-wysiwyg";constMyTextArea=({
id ="",
name ="",
value ="",
objectData,
setObjectData =()=>{},})=>{return(<divid={id}name={name}className="froala-editor-wrapper"><FroalaEditorComponenttag="textarea"model={value}onModelChange={(e)=>{setObjectData({
...objectData,text: e,});}}config={{placeholderText:"Share something new. Now with #hashtags support, YAY!!!",}}/></div>);};exportdefaultMyTextArea;
The text was updated successfully, but these errors were encountered:
I'm trying to use the React version of the Froala Editor in my application. Since this will be used in several CRUD operations, I decided to create a component to be used in all my create and update pages.
Everything works great when creating an article, however when I try to fetch a text field from MongoDB in the update pages, the HTML does not gets to render.
As briefly stated above, the string coming from the DB contains html tags:
This is my code for the update page:
The
<MyTextArea />
is the component that I created where the Froala Editor is initialized:The text was updated successfully, but these errors were encountered: