Jungwoo-An / react-editor-js

โš›๏ธ๐Ÿ“The unofficial editor-js component for React
https://codesandbox.io/s/react-editor-js-v2-34bfl
MIT License
940 stars 77 forks source link

Set editor to only reading mode #197

Closed ammasum closed 2 years ago

ammasum commented 2 years ago

I want to make editor only reading mode. How can I achieve this?

StitiFatah commented 2 years ago

pass the readOnly props as false <ReactEditorJS {....other_props} readOnly={false}/>

to toggle :

editorCore.current.readOnly.toggle()

it's working one 2.0.5 on my end but 2.0.6 throw TypeError: Cannot read properties of undefined (reading 'toggle') tho

Jungwoo-An commented 2 years ago

@ammasum Hi! First of all, thanks for your interest! ๐Ÿ‘‹

You can use readOnly prop

Thanks!