react-editor icon indicating copy to clipboard operation
react-editor copied to clipboard

many react-editor, and strange source code example...

Open jerome-diver opened this issue 4 years ago • 0 comments

i read your Readme.md file with this example code:

import { Editor } from 'react-editor'

let [value, setValue] = useState('')
let ref = useRef()

ref.focus()
ref.insertText('foo')
ref.insertHTML('<img src="https://foo.bar/baz.png">')
value = 'set content'

<Editor
  ref={ref}
  placeholder="Type message to send..."
  className={styles.editor}
  value={value}
  onChange={setValue}
/>
  • what does it mean to define value this way ? i never read this to be a good practice.

  • why is there many different repo for react-editor ? what is the idea to increase a choice and what's different from each other ? You don't explain anything around.

  • what is the ref using for there ?

jerome-diver avatar Feb 28 '21 21:02 jerome-diver