内容未在使用React Js的Web浏览器上显示

时间:2018-01-26 16:22:11

标签: javascript css reactjs

我正在尝试使用React Js添加一些内容。当我刷新页面nothings出现。没有我在代码中添加的文字,只显示黑色背景?这段代码在js / app.js下,我正在使用tach的tachyons库。

Heres'我的代码:

const Intro = () => (
<div className="m-auto-ns f4 f3-m f2-1 tc w-80-1 normal">
  <div className="mb3 mb4-ns">
    Lost in Tokyo is a directory of fun places to see, play in and explore,
    in Tokyo, Japan.{' '}
  </div>
  <div>
  From museums and galleries,
  to Robot Restaurants and kitten cafes, Tokyo is the gift that keeps on giving ,Dattebayo!{' '}
  </div>
</div>
);

const App = () => (
  <div>
    <div className="min-vh-100 ph4 flex flex-column">
      {/* our navigation component */}
      <Intro />
    </div>
    <div className="flex flex-wrap container">{/* our attractions list component */}</div>
  </div>
);

ReactDOM.render(<App />, document.getElementById('root'));

1 个答案:

答案 0 :(得分:0)

我认为你的箭头函数语法有一些错误,

  

const Intro =()=&gt; {      ...   }