Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialHarshavardhan Gangavarapu
13,727 PointsCannot find the error and cannot execute the program in react
const desc='I just learned how to create and render a react element';
const myTitleID='main-title';
const name='Harsha';
const header=(
<header>
<h1 id={myTitleID}>{name}'s first react project</h1>
<p>{desc}</p>
</header>
);
ReactDOM.render(
header,
document.getElementById('root')
);
This is the app.js code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Scoreboard</title>
<link rel="stylesheet" href="./app.css" />
</head>
<body>
<div id="root"></div>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel" src="./app.js"></script>
</body>
</html>
This is the html code
Please help me I am using windows 10 os. Does this has anything to do with the non-execution of the code? The editor I am using is 'Visual Studio code'
1 Answer
KRIS NIKOLAISEN
54,971 PointsI have this workspace snapshot with your code that appears to render ok.