Reputation: 71
I'm using react-redux, and this is my root Reducer:
import Customers from "./customers/reducer";
export default {
Customers
};
but I got this warning: Assign object to a variable before exporting as module default. How do I deal with it?
Upvotes: 5
Views: 14286
Reputation: 876
There are some solutions:
1- Disable the warning
import Customers from "./customers/reducer";
/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */
export default {
Customers
};
2- create a const then export it
import Customers from "./customers/reducer";
const aName = {
Customers
};
export default aName;
Read this descriptions For more information.
Upvotes: 11