ProNextJS
    State Management with Next.js App RouterLevel up with State Management with Next.js App Router

    I respect your privacy. Unsubscribe at any time.

    This is a free tutorial

    In exchange for your email address, you'll get full access to this and other free ProNextJS tutorials.

    Why? First and foremost, your inbox allows us to directly communicate about the latest ProNextJS material. This includes free tutorials, NextJS Tips, and periodic update about trends, tools, and NextJS happenings that I'm excited about.

    In addition to the piles of free NextJS content, you'll get the earliest access and best discounts to the paid courses when they launch.

    There won't be any spam, and every email you get will have an unsubscribe link.

    If this sounds like a fair trade, let's go!

    exercise

    Add a Review Slice to the Redux Store

    Jack HerringtonJack Herrington

    We have our cart functionality being driven by a Redux store, but now it's time to get a little bit tricky and bring in the reviews functionality.

    Challenge

    Your challenge is to update the Redux store to include a reviews slice that is initialized with product reviews.

    As you're working through this, watch for how the reviews change as you change product routes by clicking different t-shirts.

    Also, double check the server-side rendered output of the page to make sure the reviews are coming through. Remember, this is important for SEO so they need to be there.

    Revisit the Redux examples in the previous lesson if you need to!

    Transcript

    All right, so this is where it really starts to get fun. Now, we're driving our cart functionality using a Redux store. Let's see if we can implement on the reviews functionality. This is where it's going to start to get really tricky. So one of the things you need to watch out for as you're implementing is when you change routes,

    notice how the reviews are changing to the reviews for that particular product. That's really important. So as you're working through this, make sure that that works. Also, go and check out the server-side rendered output of the page so that you make sure that you're

    getting the reviews in the server-side rendered output. You want to make sure that they're in there because a requirement for an app like this is to have the reviews in the server-side rendered output. That's going to make for great search engine optimization or SEO. Now, if you have any questions,

    be sure to consult the resources. In the meantime, good luck on this mystery of figuring out the best way to initialize the reviews slice within our Redux store properly.