Change import from next/router to use wildcard (#234)

This commit is contained in:
Lukasz Ostrowski 2023-04-26 13:38:13 +02:00 committed by GitHub
parent 7c6c164a92
commit 11b793be94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@saleor/app-sdk": patch
---
Changed import type from next/router, that fixes Next 13.3.1 build

View file

@ -1,12 +1,14 @@
/**
* Use .js extension to avoid broken builds with ESM
*/
import { useRouter } from "next/router.js";
import * as NextRouter from "next/router.js";
import { useEffect } from "react";
import { actions } from "../actions";
import { useAppBridge } from "../app-bridge-provider";
const { useRouter } = NextRouter;
/**
* Synchronizes app inner state (inside iframe) with dashboard routing, so app's route can be restored after refresh
*/