Is there an issue with how I imported react or am I just missing something small? Any feedback would be greatly appreciated. I'm pretty new to programming so there's probably a really simple solution here that I'm just not informed enough to see. Thanks.
Edit: After taking out the commented out portion of the body, the component still doesn't render. I get this error
Uncaught SyntaxError: Unexpected token '<' (at index.html:22:13)
Can the file not understand that I'm trying to use a react component? Thanks.
2nd edit: Solved it, I was missing type="text/babel" in the script element.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<!-- React Import -->
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<title>Markdown Previewer</title>
</head>
<script>
class App extends React.Component {
render() {
return(
<div class="">
Hi
</div>
);
}
}
ReactDOM.render(<App/>,
document.getElementById('app'));
</script>
<body>
<!--<wrapper>
<div id="app"></div>
<textarea name="name" rows="8" cols="80" id="editor"></textarea>
<div id="preview"></div>
</wrapper>-->
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
</body>
</html>
remove comment braces: <!-- -->
and write just:
<wrapper>
<div id="app"></div>
<textarea name="name" rows="8" cols="80" id="editor"></textarea>
<div id="preview"></div>
</wrapper>