@sentinel-js/react 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -14,6 +14,31 @@ pnpm add @sentinel-js/react
14
14
 
15
15
  **Peer dependencies:** `react` and `react-dom` (>=16.8.0). You must have them installed in your app.
16
16
 
17
+ ### Vite Configuration (Required)
18
+
19
+ Add the following to your `vite.config.ts` to ensure a single React instance:
20
+
21
+ ```typescript
22
+ import { defineConfig } from 'vite';
23
+ import react from '@vitejs/plugin-react';
24
+ import sentinelPlugin from '@sentinel-js/vite-plugin';
25
+
26
+ export default defineConfig({
27
+ plugins: [
28
+ react(),
29
+ sentinelPlugin(),
30
+ ],
31
+ resolve: {
32
+ dedupe: ['react', 'react-dom'],
33
+ },
34
+ optimizeDeps: {
35
+ include: ['@sentinel-js/react'],
36
+ },
37
+ });
38
+ ```
39
+
40
+ Without `dedupe` and `optimizeDeps.include`, you may encounter React hook errors in development mode.
41
+
17
42
  ## Usage
18
43
 
19
44
  ### Option A: Standard UI (Toast Banner)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentinel-js/react",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",