Yeah no,
this should work ReactDOM.render(<App/>, document.getElementById('root'));
But it does not work. I’ve watched 20 videos now and nothing works. GPT cant figure it out either.
What I have now:
import React, { useState } from "https://cdn.skypack.dev/react";
import ReactDOM from "https://cdn.skypack.dev/react-dom";
import ReactMarkdown from "https://cdn.skypack.dev/react-markdown";
function App() {
const [markdownText, setMarkdownText] = useState("# Hello, React!");
return (
<div>
<h1>Hello</h1>
<ReactMarkdown>{markdownText}</ReactMarkdown>
</div>
);
}
ReactDOM.render(<App/>, document.getElementById('root'));
As I said, different versions of react do different things
the method you are using is deprecated since 2022. If you are using React 19 it will not work. Are they using React 18 or earlier?
When was the tutorial you are watching made?
GPT is not useful. It doesn’t know things.
Have you tried googling?
I have tried Google’ing. I could only find issues and fixes of people with typos and nothing thats really an issue which is why i wanted to created a forum post.