简体   繁体   English

回应Hello World问题

[英]React Hello World issue

I'm completly new with react and currently testing this tutorial http://jmfurlott.com/tutorial-setting-up-a-single-page-react-web-app-with-react-router-and-webpack/ 我是React的新手,目前正在测试本教程http://jmfurlott.com/tutorial-setting-up-a-single-page-react-web-app-with-react-router-and-webpack/

When I try to start the application I get the following error message: 当我尝试启动应用程序时,出现以下错误消息:

堆栈跟踪

The tutorial on that site is now out of date, as Babel 6 no longer natively supports React. 该站点上的教程现已过时,因为Babel 6不再本机支持React。 You need to include a plugin and configure webpack as appropriate. 您需要包括一个插件并适当配置webpack。

https://babeljs.io/docs/plugins/preset-react/ https://babeljs.io/docs/plugins/preset-react/

Install the plugin: 安装插件:

$ npm install babel-preset-react

You'll need to then configure your loader in webpack to use the plugin. 然后,您需要在webpack中配置加载器以使用该插件。

This blog will show you how to use webpack with babel6: https://www.twilio.com/blog/2015/08/setting-up-react-for-es6-with-webpack-and-babel-2.html 该博客将向您展示如何将Webpack与babel6结合使用: https ://www.twilio.com/blog/2015/08/setting-up-react-for-es6-with-webpack-and-babel-2.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM