Dear supporter
Could you please help to give example on how to combined Rich text editor with formik
I use change event to get the value but it keep throw error
Cannot read properties of undefined (reading 'isService')
at ComponentBase.getInjectedServices (component-base.js:562:1)
at ComponentBase.refreshChild (component-base.js:344:1)
at ComponentBase.refreshProperties (component-base.js:160:1)
at ComponentBase.updateProperties (component-base.js:149:1)
at ComponentBase.shouldComponentUpdate (component-base.js:90:1)
Hi Jay,
We have created a sample using RichTextEditor and Formik. In the sample, we have rendered the RichTextEditor component. We have gotten the values using getText public methods and set the save interval as "1" to get the modified value instantly. When we click the Submit button, we are shown the alert box with the values. Please see the sample and API links for further information.
Sample: https://codesandbox.io/s/optimistic-pine-85yvs4?file=/src/index.js
API Link:https://ej2.syncfusion.com/react/documentation/api/rich-text-editor/#gettext
Please check the above sample, and if you still face any problems, please share your full page code or runnable sample with the issue, which helps us to check and provide you with the solution at the earliest.
Regards
Gokulraj
I'm getting the same error. Some small investigation appears that
- Create basic app using "Vite" and it works
- Create basic app in "React Create App" it fails
- Create a basic app in "Remix" and it fails
Vite package
Remix package
create react app
For assistance, I've created a fork from the syncfusion's remix blog and updated to show the error
Hi Andrew,
We have validated your reported query and found that the issue occurred when passing the value as text into the Rich Text Editor. To solve your problem, we suggest you wrap the text in an element and then insert it into the Rich Text Editor or use the value property to insert the text into the Rich Text Editor. Please refer to the following code and sample for your reference.
<RichTextEditorComponent> <p>This is the default text</p> <Inject services={[HtmlEditor, Toolbar, Image, Link, QuickToolbar]} /> </RichTextEditorComponent> |
Sample: https://stackblitz.com/edit/node-pej2tf?file=app%2Fdatasource.tsx,app%2Froutes%2Findex.tsx
Value Property :
export default function Index() { var value = "Rich Text Editor"; return ( <div> <RichTextEditorComponent value={value}> <Inject services={[HtmlEditor, Toolbar, Image, Link, QuickToolbar]} /> </RichTextEditorComponent> </div> ); } |
API Link: https://ej2.syncfusion.com/react/documentation/api/rich-text-editor/#value
Regards,
Vinothkumar
Thanks,
That is working in Chrome, but for some reason the components don't style in Edge. Not sure if if that is something in my browser, issue in Edge or with your code issue. Can you let me know if you get the same issues?
Edge version is
Microsoft Edge for BusinessLearn more about Microsoft Edge for BusinessVersion 116.0.1938.69 (Official build) (64-bit)
Chrome version is
Version 116.0.5845.141 (Official Build) (64-bit)
We have faced the same issue it is due to Microsoft Edge security. However, you can open the sample in the New window to solve the issue.