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

230
Vistas
How to efficiently store data from react-quill to backend

I am making a simple blogging site using react, I am using react-quill and i can't figure out the best way to store the data from react-quill editor to the backend. From my code, the content I get is already formatted with html tags. I would like to store the data in a way that when It is stored efficiently and when retrieved from the server, it is displayed with all the formatting e.g bold text, italized... The sample code is below. Also if there is a way i can improve my code, feel free to tell me :)

import { useState } from 'react';
import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css";
import "react-quill/dist/quill.bubble.css";

const Create = () => {
    const [body, setBody] = useState('');
    const handleBody = (e) => {
        console.log(e)
        setBody(e)
    }
    return (
        <main>
            <div className="form-container">
                <form>
                    <h2>create post</h2>
                    <ReactQuill
                        placeholder='spread your message...'
                        modules={Create.modules}
                        formats={Create.formats}
                        onChange={handleBody}
                        value={body}
                    />
                    <button id="submit-btn">post</button>
                </form>
            </div>
        </main>
    )
}

Create.modules = {
    toolbar: [
      [{ 'font': [] }],
      [{ 'size': ['small', false, 'large', 'huge'] }],
      ['bold', 'italic', 'underline'],
      [{'list': 'ordered'}, {'list': 'bullet'}],
      [{ 'align': [] }],
      [{ 'color': [] }, { 'background': [] }],
      ['link', 'image'],
      ['code-block'],
      ['clean']
    ]
};

Create.formats = [
    'font',
    'size',
    'bold', 'italic', 'underline',
    'list', 'bullet',
    'align',
    'color', 'background',
    'link',
    'image',
    'code-block'
  ];

export default Create;
about 4 years ago · Juan Pablo Isaza
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