DEV Community

MANOJ AP
MANOJ AP

Posted on • Updated on

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

Top comments (0)