【发布时间】:2018-01-12 06:18:41
【问题描述】:
我必须在我的 App.js 中导入多个文件。我的文件夹结构是
/src
/components
layout.js
App.js
index.css
index.js
这里我想从App.js 导入layout.js 文件。我的代码是
import React from 'react';
import Layout from './components/layout';
class App extends React.Component{
render(){
return (
<div>
<p>Hi</p>
</div>
);
}
}
export default App;
在我的代码中,如何导入layout.js文件?
【问题讨论】:
-
import Layout from './components/layout'; -
你已经导入了
import Layout from './components/layout'; -
但它不起作用
标签: javascript reactjs