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

226
Views
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
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!