Skip to content

Commit 0e33dfe

Browse files
committed
fix: error was caused by another package using unpublished version of r18gs
1 parent b64f22e commit 0e33dfe

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

examples/nextjs/src/app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "./styles.css";
22
import "react18-loaders/dist/index.css";
3-
import { Core } from "nextjs-darkmode-lite";
3+
import { Core } from "nextjs-darkmode";
44
import { Layout } from "@repo/shared/dist/server";
55
import { GlobalLoader, Header } from "@repo/shared";
66
import { Inter } from "next/font/google";

lib/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const useRGS = <T>(
3131
v: value instanceof Function ? value() : value,
3232
l: [],
3333
s: createSetter(key),
34-
u: createSubcriber(key, fields),
3534
};
3635

3736
return createHook<T>(key, fields);

lib/src/utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type RGS = {
1616
v: unknown;
1717
l: ListenerWithSelectors[];
1818
s: SetStateAction<unknown> | null;
19-
u: Subscriber;
2019
};
2120

2221
declare global {
@@ -104,7 +103,7 @@ export const initWithPlugins = <T>(
104103
value = value instanceof Function ? value() : value;
105104
if (doNotInit) {
106105
/** You will not have access to the setter until initialized */
107-
globalRGS[key] = { v: value, l: [], s: null, u: createSubcriber(key, fields) };
106+
globalRGS[key] = { v: value, l: [], s: null };
108107
return;
109108
}
110109
/** setter function to set the state. */
@@ -122,8 +121,7 @@ export const initWithPlugins = <T>(
122121
if (rgs) {
123122
rgs.v = value;
124123
rgs.s = setterWithPlugins;
125-
} else
126-
globalRGS[key] = { v: value, l: [], s: setterWithPlugins, u: createSubcriber(key, fields) };
124+
} else globalRGS[key] = { v: value, l: [], s: setterWithPlugins };
127125
initPlugins(key, plugins);
128126
};
129127

0 commit comments

Comments
 (0)