我有这些文件和文件夹。
App.js
modules/
user/
index.js
list.js
在list.js中,我有
export default (props) => (...)
在index.js中,我有export UserList from './list';
在App.js中,我有import { UserList } from './modules/user';
这里有什么问题吗?因为我得到了./src/modules/user/index.js
Syntax error: Unexpected token, expected { (1:7)
> 1 | export UserList from './list';
但我不明白这里有什么问题?请帮忙!
编辑:这是我的list.js文件的更多细节,但我认为这并没有关系,因为错误出现在index.js中。
import React from 'react';
// more import
export default (props) => (
<List {...props}>
...
</List>
);
import UserList from './list; export default UserList
。 - Ozgur