Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use reac-quill libaray without any issue #274

Open
adanyal46 opened this issue Sep 4, 2024 · 0 comments
Open

use reac-quill libaray without any issue #274

adanyal46 opened this issue Sep 4, 2024 · 0 comments

Comments

@adanyal46
Copy link

Jodit Version: 3.4.xxxxx

Browser:
OS:
Is React App:

Code

import React, { useEffect, useState } from "react";
import ReactQuill from "react-quill";
import "react-quill/dist/quill.snow.css"; // import styles

const suppressQuillWarnings = () => {
  const originalConsoleWarn = console.warn;
  console.warn = (message, ...rest) => {
    if (message && message.includes("DOMNodeInserted")) {
      return;
    }
    originalConsoleWarn(message, ...rest);
  };
};

const MyEditor = ({value, onChange, label}) => {
  useEffect(() => {
    suppressQuillWarnings();
  }, []);

  return (
    <div>
      <label className="block text-sm font-medium text-gray-700 mb-2">{label}</label>
      <div>
        <ReactQuill value={value} onChange={onChange} placeholder="Start typing..." />
      </div>
    </div>
  );
};

export default MyEditor;

Expected behavior:

Actual behavior:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant