DEV Community

MANOJ AP
MANOJ AP

Posted on • Edited on

1

React client error

When I work with react-quill and react-editor-js I got either a double instance or an error which shows react-dom/client error.

I fix problem by using render method. The two of the cases caused by the same.

Editorjs

Image description

Quilljs

Image description

index.js

`import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(



);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();`

Fix worked for me.

import ReactDOM from "react-dom";
import React from "react";
// import { createRoot } from "react-dom/client";

import App from "./App";

const rootElement = document.getElementById("root");
// const root = createRoot(rootElement);
ReactDOM.render(, rootElement);

My question is that, why this happening ?

More thoughts on JSU

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay