我想通过这个tutorial来学习ReactJS。尽管我不能在我的浏览器中运行Hello World示例。
我尝试运行以下代码:
<head>
<meta charset="UTF-8">
<title>Dev ReactJS</title>
<!-- <script src="build/react.js"></script> -->
<script src="build/react-with-addons.js"></script>
<script src="build/JSXTransformer.js"></script>
</head>
<body>
<div id="mount"></div>
<script type="text/jsx">
/** @jsx React.DOM */
React.render(
React.DOM.h1(null, 'Hello, world!'),
document.getElementById('mount')
);
</script>
</body>
</html>
这将生成如下所示的错误:
Uncaught TypeError: React.render is not a function - Inline JSX script:3
我已经阅读了一些关于v0.14中的更改的内容,但我使用的是初学者工具包,包括v0.11。我是通过FTP上传到我的网站的,还是有必要在例如NodeJS服务器上运行?我找不到关于那个的任何东西..
提前谢谢。
发布于 2016-02-29 19:27:29
这篇文章写于2014年,react生态系统发生了很多变化。这篇由Pete Hunt编写的react-howto指南将在您进入有时势不可挡的react生态系统的旅程中证明是有用的
https://stackoverflow.com/questions/35698003
复制相似问题