Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
Anonymous arrow functions cause Fast Refresh to not preserve local component state

I have this code in my pages/index.js file:

import React from 'react';
import dynamic from 'next/dynamic';

const TVChartContainer = dynamic(
    () =>
        import('../components/TVChartContainer').then(mod => mod.TVChartContainer),
    { ssr: false },
);

export default () => <TVChartContainer />;

And this gives me an error.

Anonymous arrow functions cause Fast Refresh to not preserve local component state. Please add a name to your function, for example:

Before export default () => ;

After const Named = () => ; export default Named;

A codemod is available to fix the most common cases: https://nextjs.link/codemod-ndc

And then I tried to export the component this way.

export default  TVChartContainer;

This also seems not fixing the issue. How do I fix this issue?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As the error message suggests, you need to add a name to the function component you're exporting.

const IndexPage = () => <TVChartContainer />

export default IndexPage;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!