Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda