Hi there I am struggling to understand / have this eslint error disappear with my React Project.
Prefer default export import/prefer-default-export
Helpers.js error is pointing to:
export function getItems() {
fetch('./data/data_arr.js')
.then(results => results.json())
.then(results => this.setState({ items: results }));
}
import of function:
import { getItems } from '../helpers/helpers';
componentDidMount() {
getItems.call(this);
}
I have tried to no avail:
"rules": {
"import/prefer-default-export": off,
...
}
Do I need to add "default" to the function? export default function getItems() {...}
Thank you
"rules": {
"import/prefer-default-export": "off",
...
}
The word off
has to be quoted.