I am trying to code the reactjs tutorial in visual studio 2015 sp2 http://reactjs.net/getting-started/tutorial.html
I am just on the first step, I created the jsx file, the controller and a view file, when I run it, I just get a blank page no error, I am not sure what I am doing wrong. Here is the content of the index.cshtml file.
<html>
<head>
<title>Hello React</title>
</head>
<body>
<div id="content"></div>
<script src="@Url.Content("~/Scripts/Tutorial.jsx")"></script>
</body>
</html>
Here is my tutorial.jsx file
var CommentBox = React.createClass({
render: function() {
return (
<div className="commentBox" />
Hello, world! I am a CommentBox.
Sorry I am so retarded and hard to work on that it appears impossible to get me to display.
</div>
);
}
});
React.render(
<CommentBox />,
document.getElementById('content')
);
Page Renders but nothing displays within the <div> and I am not sure why.
I had to remove the script tags for the reactjs files as the editor for this question was pitching a fit about them, they are there in my code.
What I am really looking for is how to edit jsx files in visual studio 2015 and get babel to create the js files for me. I downloaded the reactjs starter kit, but that didn't work. I finally managed to get a working environment setup by downloading all the files using npm, but I really want to be able to edit in visual studio, so I can publish the finished code to my website, which is using asp.net and targeting 4.6.1 version of the .net framework.