---
title: "Upgrade JSS apps to JSS 21.7"
slug: "upgrade-jss-apps-to-jss-21-7"
abstract: "Follow this guide to upgrade your JSS apps to JSS 21.7. For Next.js apps, you will upgrade to Next.js 14. For React, you will replace some dependencies. In the Node headless SSR proxy, there is a small update to the Layout service query params."
---
# Upgrade JSS apps to JSS 21.7

Sitecore JavaScript Rendering SDK version 21.7 brings changes to JSS packages, other NPM dependencies, and some environment variables.

> [!note]
> **Before you begin**
> -   If you haven't already done so, [upgrade your app to JSS 21.6](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/upgrade-jss-apps-to-jss-21-6.html "Upgrade JSS apps to JSS 21.6").
>
> -   Familiarize yourself with the [JSS 21.7 release notes](https://github.com/Sitecore/jss/releases/tag/v21.7.0) to ensure you understand the implications of upgrading.

This topic describes how to:

- [Update dependencies in React apps](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/upgrade-jss-apps-to-jss-21-7.html#UUID-226332c4-c076-6af9-53d3-2df5198b4410_section-idm4663567482704034123553332468 "Update dependencies in React apps").
- [Upgrade JSS Next.js apps to JSS 21.7](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/upgrade-jss-apps-to-jss-21-7.html#UUID-226332c4-c076-6af9-53d3-2df5198b4410_section-idm4603080884340834123838250605 "Upgrade JSS Next.js apps to JSS 21.7").
- [Update the Node headless SSR proxy app](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/upgrade-jss-apps-to-jss-21-7.html#UUID-226332c4-c076-6af9-53d3-2df5198b4410_section-idm4542112576596834123569394651 "Update the Node headless SSR proxy app").

## Update dependencies in React apps

Upgrading your applications based on JSS templates requires changing some dependencies and replacing their usage.

To upgrade your applications:

1. In your `package.json` file, update every `@sitecore-jss` dependency to use the `~21.7.0` version and replace the `deep-equal` dependency with `fast-deep-equal` version `^3.1.3`.
2. In a shell, install or update dependencies in your app by running the following command:

    ```shell
    npm install
    ```

3. Update the `/src/Layout.js` file as follows:
    - Remove the `deepEqual` import statement.
    - Import the `fastDeepEqual` function from the newly added dependency:

        ```text
        import fastDeepEqual from 'fast-deep-equal/es6/react';
        ```

    - Replace the usage of the `deepEqual` function with the `fastDeepEqual` function:

        ```text
        if (fastDeepEqual(prevProps.route, nextProps.route)) return true;
        ```

## Upgrade JSS Next.js apps to JSS 21.7

In JSS 21.7, Sitecore [improved GraphQL retries and upgraded Next.js to version 14](https://github.com/Sitecore/jss/releases/tag/v21.7.0).

To upgrade JSS Next.js apps:

- Follow the [detailed upgrade guide from JSS 21.6.4 to 21.7 for JSS Next.js apps](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-headless-development/upgrade-jss-21-6-4-next-js-apps-to-version-21-7.html "Upgrade JSS 21.6.4 Next.js apps to version 21.7").

## Update the Node headless SSR proxy app

In JSS 21.7, the Node headless SSR proxy template adds the `sc_site` query parameter to Layout Service requests.

To update your Node headless SSR proxy app:

- In the `/src/config.ts` file, add query string parameters for Layout service requests using the `qsParams` configuration property, as follows:

    ```ts
    setHeaders: (_req, _serverRes, proxyRes) => {
        delete proxyRes.headers['content-security-policy'];
      },
      /**
    * Query string parameters to add to Layout Service requests.
    */
    qsParams: sc_site=${siteName},
    //...
    ```