Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
Why is next.js giving me this error: 'Anonymous arrow functions cause Fast Refresh to not preserve local component state.'

I had a project in a git repo. I tried to push it to github and it wouldn't let me. It said the version on github was more recent than the one on my local machine. But I only dev on this machine, and I had not pushed new changes for days. So I had a lot of changes I didn't want to lose. So, I just tried to delete the .git file and start fresh. But it was giving me issues. So I just copied the entire file structure over to a new file to start fresh. But now it is giving me a warning 'Anonymous arrow functions cause Fast Refresh to not preserve local component state.'

I had never gotten this warning when working out of the other folder.

What's even more confusing, the page it is throwing a warning for, the _app.js file, exports a named function.

I dont understand.

Here's the _app.js file.

import '../styles/globals.css'
import Layout from '../components/Layout';
import { useState } from 'react';

export default function MyApp({ Component, pageProps }) {
  // state
  let [activeTab, setActiveTab] = useState('Sign In')

  return (
    <Layout activeTab={activeTab}>
      <Component {...pageProps} />
    </Layout>
  )
}

I even checked the layout component, wondering if that one was anonymous. It's not.

import styles from '../styles/styles.module.scss';
import Sidebar from './Dashboard/Sidebar';

export default function Layout({children, activeTab}){
    return (
        <div className={styles.container}>
            <div className={styles.main}>
            <div className={styles.dash}>
                <Sidebar activeTab={activeTab}/>
                <div className={styles.content}>
                    {children}
                </div>
            </div>
            </div>
        </div>
    )
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda