Closed Tymek closed 4 years ago
@Tymek Hi! First of all, thanks for your interest! π
I thought about this proposal, but i think it is not necessary feature. because It can already use with the react hook. (Example)
Thanks!
I'll close this issue. If you have anything more to say, please reopen issue.
Thanks! π
Appreciate the example @Jungwoo-An!
Just wanted to add an auto-save version I adapted in case others find this issue.
import EditorJS from '@editorjs/editorjs'
import React, { useCallback, useRef } from 'react'
import EditorJs from 'react-editor-js'
import { EDITOR_JS_TOOLS } from './tools'
export const Editor = () => {
const editorRef = useRef<EditorJS>()
const handleChange = useCallback(async () => {
const data = await editorRef.current?.save()
if (data) {
console.log(data)
}
}, [])
return (
<EditorJs
tools={EDITOR_JS_TOOLS}
instanceRef={instance => (editorRef.current = instance)}
onChange={handleChange}
/>
)
}
@Tymek Hi! First of all, thanks for your interest! π
I thought about this proposal, but i think it is not necessary feature. because It can already use with the react hook. (Example)
Thanks!
Hi ! Thank you for the react hook example! Im trying the sandbox and as in my test, the block image doesnt work. Im receiving the same message " Can not upload an image, try another " Is there a reason ?
I wrote my own implementation of React container for Editor.js, and instead of creating separate package I'd like to volunteer my contributions and help here. Example use case would look like:
Where
useEditorRef
is optional and can be replaced with standarduseRef
. That will allow you to access EditorJS instance with all standard methods atref.current
.Does this sound like a good idea for this repo?