Unverified Commit 8c547139 authored by Byron's avatar Byron Committed by GitHub

add filename to babel warning about anonymous function default exports (#31322)

fixes #29667

I didn't add an integration test, but I can take a stab at it if you point me in the right direction!
parent e5171758
...@@ -40,6 +40,7 @@ export default function NoAnonymousDefaultExport({ ...@@ -40,6 +40,7 @@ export default function NoAnonymousDefaultExport({
chalk.yellow.bold( chalk.yellow.bold(
'Anonymous arrow functions cause Fast Refresh to not preserve local component state.' 'Anonymous arrow functions cause Fast Refresh to not preserve local component state.'
), ),
chalk.cyan(this.file.opts.filename),
'Please add a name to your function, for example:', 'Please add a name to your function, for example:',
'', '',
chalk.bold('Before'), chalk.bold('Before'),
...@@ -64,6 +65,7 @@ export default function NoAnonymousDefaultExport({ ...@@ -64,6 +65,7 @@ export default function NoAnonymousDefaultExport({
chalk.yellow.bold( chalk.yellow.bold(
'Anonymous function declarations cause Fast Refresh to not preserve local component state.' 'Anonymous function declarations cause Fast Refresh to not preserve local component state.'
), ),
chalk.cyan(this.file.opts.filename),
'Please add a name to your function, for example:', 'Please add a name to your function, for example:',
'', '',
chalk.bold('Before'), chalk.bold('Before'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment