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

227
Views
Redux hooks don't work inside the Next JS Head Tag

I was setting up redux in my Next JS project but the useDispatch hook wasn't working inside my Nav component. The nav was wrapped in the tag provided by Next JS. But when I moved my Nav component outside the tag, the useDispatch hook started working. Why is my app behaving like this?

Error: react-redux context value error

_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>
    )
}

index.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!