S
S
smurzak32022-04-19 18:38:13
React
smurzak3, 2022-04-19 18:38:13

React_dom_client__WEBPACK_IMPORTED_MODULE_3__.render is not a function?

Hello, there is a code that renders the layout, and this error appears in the console: import ReactDOM from 'react-dom/client';
:

for (var i = 0; i < cardList.length; i++) {
    console.log(cardList[i].name)
    ReactDOM.render(
        React.createElement('div', {className: "message"}, cardList[i]),
        document.getElementById('myApp')
    ); 
  }

Import code:
import { useState} from 'react';
import React from 'react'
import './textDownload';
import './App.css';
import ReactDOM from 'react-dom/client';
import MyApp from './textDownload';

Tell me, what could be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question