From 00ee489adfb68fc364ec5669b664cc4e878a5b35 Mon Sep 17 00:00:00 2001 From: Amirhossein Alibakhshi Date: Mon, 3 Nov 2025 12:50:38 +0330 Subject: [PATCH 1/2] fix: resolve typeo issues in `shouldUseStob` --- packages/react/src/SocketClientProvider.tsx | 6 +++--- packages/react/src/types.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/SocketClientProvider.tsx b/packages/react/src/SocketClientProvider.tsx index 7ff6d06..cd8b76e 100644 --- a/packages/react/src/SocketClientProvider.tsx +++ b/packages/react/src/SocketClientProvider.tsx @@ -26,7 +26,7 @@ const __SINGLETON_REFS__: Record< * Properties: * - `children` (`React.ReactNode`): React children to render within the provider. * - `uri` (`string`): The URI to connect the socket client to. - * - `shouldUseStob?` (`boolean`): Optional flag indicating whether to use the stubbed version of `ClientSocketManager` (useful for SSR or testing). + * - `shouldUseStub?` (`boolean`): Optional flag indicating whether to use the stubbed version of `ClientSocketManager` (useful for SSR or testing). * - Additional props from `ClientSocketManagerOptions` can be provided, such as `eventHandlers`, `reconnectionDelay`, etc. * * @param props - Props for the provider, including connection URI, stub flag, and socket manager options. @@ -34,7 +34,7 @@ const __SINGLETON_REFS__: Record< * * @example * ```tsx - * + * * * * ``` @@ -58,7 +58,7 @@ const SocketClientProvider = (props: SocketClientProviderProps) => { React.useEffect(() => { if (!__SINGLETON_REFS__[uri]) { - if (props.shouldUseStob) { + if (props.shouldUseStub) { registerClientSocketManager(new ClientSocketManagerStub(uri, {})); } else { const client = new ClientSocketManagerOriginal(uri, { diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index ba67266..9ede91d 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -53,5 +53,5 @@ export type SocketClientProviderProps = { * Optional flag indicating whether to use the stubbed version of * ClientSocketManager. This is useful for SSR or tests. */ - shouldUseStob?: boolean; + shouldUseStub?: boolean; } & Partial; From ec222c59c423b01cc0d95eecdd1324aaa9ad9336 Mon Sep 17 00:00:00 2001 From: Amirhossein Alibakhshi Date: Mon, 3 Nov 2025 12:51:07 +0330 Subject: [PATCH 2/2] docs: mention core package in react documentation --- .changeset/slimy-geckos-sniff.md | 6 ++++++ packages/react/README.md | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/slimy-geckos-sniff.md diff --git a/.changeset/slimy-geckos-sniff.md b/.changeset/slimy-geckos-sniff.md new file mode 100644 index 0000000..43a2a52 --- /dev/null +++ b/.changeset/slimy-geckos-sniff.md @@ -0,0 +1,6 @@ +--- +"@tapsioss/react-client-socket-manager": minor +--- + +Fix typo in `shouldUseStub` property for the `SocketClientProvider`. + \ No newline at end of file diff --git a/packages/react/README.md b/packages/react/README.md index d0c70a9..42e03c4 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -18,6 +18,9 @@ connections using `socket.io-client`. It provides easy setup and management of socket connections with support for automatic reconnections, event handling, and visibility change management. +> [!NOTE] +> For detailed information about the core functionality and additional features, please refer to the [@tapsioss/client-socket-manager core package documentation](https://github.com/Tap30/client-socket-manager/blob/main/packages/core/README.md). + ## Installation First, install the necessary dependencies: