Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
draft.js Reemplazar pegar imagen

Actualmente tenemos una demanda para esta característica

  1. Pegue la imagen en draft.js
  2. Reemplace la imagen pegada en el paso 1 con una nueva imagen un momento después

Hemos implementado con éxito el paso 1, pero no tenemos idea de cómo implementar el paso 2

ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí

Para el paso 1, nuestro código es así

 const currentContent = editorState.getCurrentContent() const entity = currentContent.createEntity('image', 'IMMUTABLE', { src: base64, id: id, }) const newState = EditorState.set(editorState, { currentContent: entity, }) const lastKey = entity.getLastCreatedEntityKey() setEditorState(AtomicBlockUtils.insertAtomicBlock(newState, lastKey, ' '))

Para el Paso 2, probamos la API así.

 Modifier.replaceWithFragment

Pero no pude resolverlo

¿Alguien sabe la solución?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!