Skip to content

Commit 045bab2

Browse files
committed
chore: bump version to 2.2.0 and update CHANGELOG to reflect removal of next.js useRouter support
1 parent b2ce141 commit 045bab2

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# react-content-manager
22

3+
## 2.2.0
4+
5+
### Minor Changes
6+
7+
- Removed support to execute useRouter from next.js, because it blocked way to work with Vite and forces developer to always refresh RSC (react server components). If you want to still have this feature you can pass it inside onSuccess/onFailure as params of saveChange
8+
39
## 2.1.5
410

511
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-content-manager",
3-
"version": "2.1.5",
3+
"version": "2.2.0",
44
"description": "enable editable components in your react app",
55
"keywords": [
66
"react",

src/context/CMConfigContext.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ export const CMConfigContextProvider = (
3838
const [isSaving, setIsSaving] = useState(false);
3939
const [api, contextHolder] = notification.useNotification();
4040

41-
let nextRouter = null;
42-
// @TODO remove it or load it a way that it will support Vite
43-
nextRouter = require("next/navigation").useRouter();
44-
4541
const setModeHandler = useCallback(
4642
(mode: "edit" | "view") => {
4743
setMode(mode);
@@ -61,9 +57,6 @@ export const CMConfigContextProvider = (
6157
setIsSaving(true);
6258
const persister = getPersister();
6359
await persister(configId, componentId, props);
64-
if (nextRouter) {
65-
nextRouter.refresh();
66-
}
6760
if (onSuccess) {
6861
onSuccess();
6962
} else {
@@ -88,7 +81,7 @@ export const CMConfigContextProvider = (
8881
setIsSaving(false);
8982
}
9083
},
91-
[nextRouter],
84+
[],
9285
);
9386

9487
const contextValue: CMConfigContextProps = {

0 commit comments

Comments
 (0)