Jungwoo-An / react-editor-js

βš›οΈπŸ“The unofficial editor-js component for React
https://codesandbox.io/s/react-editor-js-v2-34bfl
MIT License
954 stars 77 forks source link

Read Only #186

Closed Ashish-3000 closed 2 years ago

Ashish-3000 commented 2 years ago

Can you add read-only feature I have tried to access it from the instance created but the object fields are added after some time so that's why it's hard to access it.

Jungwoo-An commented 2 years ago

@Ashish-3000 Hi! First of all, thanks for your interest! πŸ‘‹

You can use readOnly Prop πŸ™ŒπŸ»

Thanks!

Kentakoong commented 2 years ago

can I ask a question? right now I am using readOnly with a useState hook. Looks like it won't update the state of readOnly. I want it to be dynamically changable.

looks like editorCore.current.readOnly.toggle() is not working.

ps: const editorCore = useRef<EditorJS | null>(null);

Jungwoo-An commented 2 years ago

@Kentakoong Oh, Thank you! I'll fix it.