How to fix hook error with AppProvider from discount-app-components library?

Dear community,
I am getting a hook error using from** @Shopify_77 /discount-app-components**library.
You can replicate the error Wrapping part of the App.tsx of your project with the tag.

import { BrowserRouter } from "react-router-dom";
import { NavigationMenu } from "@shopify/app-bridge-react";
import { AppProvider } from '@shopify/discount-app-components';
import Routes from "./Routes";

import {
  AppBridgeProvider,
  QueryProvider,
  PolarisProvider,
} from "./components";

export default function App() {
  // Any .tsx or .jsx files in /pages will become a route
  // See documentation for 

Error:

```javascript
Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    resolveDispatcher _discount-app-components.js:6448
    useMemo23 _discount-app-components.js:6495
    AppProvider _discount-app-components.js:39224
    renderWithHooks chunk-6YPNWHZK.js:11191
The above error occurred in the