我正在尝试使用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'));
答案 0 :(得分:0)
我认为你的箭头函数语法有一些错误,
const Intro =()=&gt; { ... }