小编Rya*_*ams的帖子

为什么我收到此javascript错误?

我没有在附近完成,但当我尝试npm开始这个项目我得到错误:

 Unexpected token, expected ;

  2 |
  3 |
> 4 | const App = fucntion() {
    |                        ^
  5 |   return <div>HI!</div>;
  6 | }
  7 |
Run Code Online (Sandbox Code Playgroud)

这是index.js的完整文件:

import React from 'react';


const App = fucntion() {
  return <div>HI!</div>;
}



//shove into dom (page)
React.render(App);
Run Code Online (Sandbox Code Playgroud)

javascript node.js reactjs redux react-redux

-4
推荐指数
1
解决办法
35
查看次数

标签 统计

javascript ×1

node.js ×1

react-redux ×1

reactjs ×1

redux ×1