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

1.4K
Views
Error de hidratación debido a la declaración if en Next.js

Recibo tres errores debido a la declaración if en mi archivo _app.js.

 Error: Hydration failed because the initial UI does not match what was rendered on the server. Error: Hydration failed because the initial UI does not match what was rendered on the server. Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

¿Cuál es la causa del error y cómo lo soluciono?

 import '../styles/globals.css' import Popup from "../components/register-popup.js"; import { getCookies, setCookies, removeCookies } from 'cookies-next'; var isValid = getCookies("noPopup").noPopup != "valid"; function MyApp({ Component, pageProps }) { if (isValid) { return ( <div> <Popup /> </div> ) } else { return ( <div> <Component {...pageProps} /> </div> ) } } export default MyApp
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

cambia tu código

 import '../styles/globals.css' import Popup from "../components/register-popup.js"; import { getCookies, setCookies, removeCookies } from 'cookies-next'; function MyApp({ Component, pageProps }) { const isValid = getCookies("noPopup").noPopup != "valid"; if (isValid) { return <Popup /> } else { return <Component {...pageProps} /> } } export default MyApp
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!