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

226
Views
Los ganchos Redux no funcionan dentro de la etiqueta Next JS Head

Estaba configurando redux en mi proyecto Next JS, pero el enlace useDispatch no funcionaba dentro de mi componente Nav. La navegación estaba envuelta en la etiqueta proporcionada por Next JS. Pero cuando moví mi componente Nav fuera de la etiqueta, el enlace useDispatch comenzó a funcionar. ¿Por qué mi aplicación se comporta así?

Error: error de valor de contexto de react-redux

_app.js:

 import "../styles/globals.css"; import { useStore } from "../app/store/store"; import { Provider } from "react-redux"; 2 export default function App({ Component, pageProps }) { const store = useStore(pageProps.initialReduxState); return ( <Provider store="{store}"> <Component {...pageProps} /> </Provider> ) }

índice.js:

 import styles from "../styles/Home.module.css"; import Head from "next/head"; import { useEffect } from "react"; import { useDispatch } from "react-redux"; import { authCheckState } from "../app/store/actions/auth"; import Nav from "../app/components/Nav"; import Footer from "../app/components/Footer"; import MainCarousel from "../app/components/MainCarousel"; import BestSellers from "../app/components/BestSellers"; export default function Home() { const dispatch = useDispatch(); useEffect(() => { dispatch(authCheckState()); }); return ( <> <Head> <Nav /> </Head> <main className={styles.main}> <MainCarousel /> <BestSellers /> </main> <Footer /> </> ); }
about 4 years ago · Juan Pablo Isaza
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!