Skip to content

Commit d47112d

Browse files
committed
chore: update use client
1 parent 3f68e16 commit d47112d

6 files changed

Lines changed: 11 additions & 8 deletions

File tree

packages/next/src/root.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
*/
55

66
import type { ReactNode } from "react";
7-
import { getReplaneSnapshot } from "@replanejs/react";
8-
import { type ReplaneClientOptions } from "@replanejs/sdk";
7+
import { getReplaneSnapshot, type ReplaneClientOptions } from "@replanejs/sdk";
98
import { ReplaneProvider } from "@replanejs/react";
109

1110
/**

packages/react/src/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client';
1+
"use client";
22

33
import { createContext } from "react";
44
import type { ReplaneContextValue } from "./types";

packages/react/src/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client';
1+
"use client";
22

33
import { useCallback, useContext, useEffect, useRef, useSyncExternalStore } from "react";
44
import { ReplaneContext } from "./context";

packages/react/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
export { ReplaneProvider } from "./provider";
24
export { useReplane, useConfig, createReplaneHook, createConfigHook } from "./hooks";
35
export { clearSuspenseCache } from "./useReplaneClient";

packages/react/src/provider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client';
1+
"use client";
22

33
import { useMemo } from "react";
44
import { restoreReplaneClient } from "@replanejs/sdk";
@@ -32,7 +32,9 @@ function ReplaneProviderWithSnapshot<T extends object>({
3232
options,
3333
snapshot,
3434
children,
35-
}: ReplaneProviderWithOptionsProps<T> & { snapshot: NonNullable<ReplaneProviderWithOptionsProps<T>["snapshot"]> }) {
35+
}: ReplaneProviderWithOptionsProps<T> & {
36+
snapshot: NonNullable<ReplaneProviderWithOptionsProps<T>["snapshot"]>;
37+
}) {
3638
const client = useStateful(
3739
() =>
3840
restoreReplaneClient<T>({

packages/react/src/useReplaneClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client';
1+
"use client";
22

33
import { useEffect, useRef, useState } from "react";
44
import { createReplaneClient } from "@replanejs/sdk";
@@ -108,7 +108,7 @@ export function useReplaneClientSuspense<T extends object = any>(
108108
}
109109
return client;
110110
})
111-
.catch((err) => {
111+
.catch((err: unknown) => {
112112
const entry = suspenseCache.get(cacheKey);
113113
if (entry) {
114114
entry.error = err instanceof Error ? err : new Error(String(err));

0 commit comments

Comments
 (0)