18 |
21 |
22 | {messages.map((message, i) => (
23 |
{message}
24 | ))}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/examples/rakkas/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "ESNext",
5 | "esModuleInterop": true,
6 | "forceConsistentCasingInFileNames": true,
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "moduleResolution": "Node",
10 | "resolveJsonModule": true,
11 | "jsx": "react-jsx",
12 | "baseUrl": ".",
13 | "types": ["vite/client"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/rakkas/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import rakkas from "rakkasjs/vite-plugin";
3 | import tsconfigPaths from "vite-tsconfig-paths";
4 |
5 | export default defineConfig({
6 | plugins: [tsconfigPaths(), rakkas()],
7 | });
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "socket.io-react-hook",
3 | "version": "2.4.5",
4 | "private": true,
5 | "type": "module",
6 | "scripts": {
7 | "build": "turbo run build",
8 | "release": "bumpp package.json packages/*/package.json examples/*/package.json && pnpm -r publish --access=public",
9 | "test": "test-e2e"
10 | },
11 | "devDependencies": {
12 | "@brillout/test-e2e": "^0.1.22",
13 | "bumpp": "^8.2.1",
14 | "turbo": "^1.13.4"
15 | },
16 | "engines": {},
17 | "dependencies": {
18 | "kill-port": "^2.0.1"
19 | },
20 | "packageManager": "pnpm@9.6.0",
21 | "pnpm": {
22 | "overrides": {
23 | "socket.io-react-hook": "link:./packages/socket.io-react-hook/"
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/socket.io-react-hook/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | src
3 | !dist
4 | .turbo
--------------------------------------------------------------------------------
/packages/socket.io-react-hook/README.md:
--------------------------------------------------------------------------------
1 | React hooks for socket.io 4.x
2 |
3 | Examples:
4 | - [Next.js](examples/next/)
5 | - [Rakkas](examples/rakkas/) - [Try on StackBlitz](https://stackblitz.com/github/nitedani/socket.io-react-hook/tree/main/examples/rakkas?file=src%2Froutes%2Findex.page.tsx)
6 |
7 | ---
8 | Usage: