0
我是新来的webpack,我开始构建一个应用程序使用webpack和反应15,但它就像导出默认不能正常工作,因为我得到一个错误作为应用程序组件未发现:导出默认不工作webpack,reactjs
5:9 App not found in './components/App' import/named
下面我index.js的代码:
import React from 'react';
import ReactDOM from 'react-dom';
import {Router,Route,IndexRoute,browserHistory} from 'react-router';
import { Provider } from 'react-redux';
import {App} from './components/App';
import {HomePage} from './components/HomePage';
import configureStore from './store/configureStore.js';
import { syncHistoryWithStore } from 'react-router-redux';
const store = configureStore();
const history = syncHistoryWithStore(browserHistory, store);
ReactDOM.render(
<Provider store={store}>
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={HomePage}/>
</Route>
</Router>
</Provider>,
document.getElementById('app')
);
和组件文件夹下放在我App.js代码:
import React, { PropTypes } from 'react';
const App = (props) => {
return (
<div>
{props.children}
</div>
);
};
App.propTypes = {
children: PropTypes.element
};
export default App;
任何人都可以看到问题吗?看起来这种类型的导出不受支持,我必须启用某些功能? 任何帮助感谢!