This is a migrated thread and some comments may be shown as answers.

How to set a initial value for an Editor component

2 Answers 379 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Dongsheng
Top achievements
Rank 1
Dongsheng asked on 17 Jul 2018, 06:31 AM

Hi,

I am using the "kendo-editor-react-wrapper" in my project, and I want to set a initial value for the Editor component. But I cannot find any helpful thing in EditorOption (including change, keyup, keydown, tools, …, etc.)

I know that I can use Editor.value() to set a value for an editor object, but how can I do this in React?

I found someone wrote like <Editor value={the_value} /> : https://stackoverflow.com/questions/48704782/kendo-editor-react-wrapper-display-an-error 

But when I try to write like this, I got an error: " TS2339: Property 'value' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Editor> & Readonly<{ children?: ReactNode; }> & Re...'."

 

ReactJS 15.6.1 and Typescript 2.4.1 are used in my project.

Maybe I have made some stupid mistakes, but I would be grateful if you could provide a solution or suggestion.

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Jul 2018, 08:31 AM
Hello, Dongsheng,

Thank you for the information.

This is an issue which is already fixed and it will be available in the latest version of the Editor.

Also, currently the content can be set  by adding a teaxarea element and pass the content string as children:

<Editor height={500}>
    <textarea>
        {this.props.value}
    </textarea>
</Editor>

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dongsheng
Top achievements
Rank 1
answered on 17 Jul 2018, 09:48 AM

Hi Stefan,

Thanks a lot. This works fine for me.

Tags
Wrappers for React
Asked by
Dongsheng
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Dongsheng
Top achievements
Rank 1
Share this question
or