Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
react draft wysiwyg not displaying styles in next js

so the html is like this:

<p><span style="color: rgb(250,197,28);font-size: 96px;">Hello</span><span style="font-size: 96px;"> </span><span style="color: rgb(251,160,38);font-size: 96px;">World</span></p>

and my text editor creating with content is like this

useEffect(() => {
    if (content !== "") {
      console.log(content);
      const contentBlock = convertFromHTML(content);
      const contentState = ContentState.createFromBlockArray(
        contentBlock.contentBlocks
      );
      const editorState = EditorState.createWithContent(contentState);

      setEditorState(editorState);
    }
  }, []);

so the inline styles are not being generated even though they are there and have correct syntext and should be generated but is there something wrong with this code or also I am using next js 12 if that helps

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Simple passing the contentBlock will work. Use as below:

const contentBlock = convertFromHTML(content);    
const contentState = ContentState.createFromBlockArray(contentBlock);
const editorState = EditorState.createWithContent(contentState);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda