So, I have these files and folders.
App.js
modules/
user/
index.js
list.js
In list.js I have export default (props) => (...)
In index.js, I have export UserList from './list';
And in App.js I have import { UserList } from './modules/user';
Something is wrong? Because i got
./src/modules/user/index.js
Syntax error: Unexpected token, expected { (1:7)
> 1 | export UserList from './list';
But I do not understand what is wrong here? Help!
Edit: here is more detailed information about my list.js file, but I don't think it matters because the error is listed in index.js
import React from 'react';
export default (props) => (
<List {...props}>
...
</List>
);
source
share