See here: https://github.com/yannickcr/eslint-plugin-react/issues/412
AFAIK, arrow functions do (and should) have names if they're assigned to a variable.
const foo = () => {}; // undefined foo.name // "foo"
export const foo = () => {};
The name works fine in the browser, but since jest/enzyme use node to run tests, I had issues with functional components (defined as arrow functions and immediately exported) were missing their names.
FWIW, this isn't an issue in Babel 7.
AFAIK, arrow functions do (and should) have names if they're assigned to a variable.
I ran into a specific bug where this doesn't work for the following case when using babel to target modern versions of node: Note that's only when the declaration is part of an export (https://github.com/babel/babel/issues/7194).The name works fine in the browser, but since jest/enzyme use node to run tests, I had issues with functional components (defined as arrow functions and immediately exported) were missing their names.
FWIW, this isn't an issue in Babel 7.