You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Fixed "Cannot read properties of undefined (reading 'recentlyCreatedOwnerStacks')" error
- Changed export pattern to avoid JSX runtime bundling issues
- Configure Vite to properly handle development and production modes
- Add comprehensive test suite for React 18 and 19 compatibility
- Update peer dependencies to support only React 18 and 19
- Bump version to 1.2.0 (breaking change: dropped React 16/17 support)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This directory contains tests to verify that react-mobile-picker works correctly with both React 18 and React 19.
4
+
5
+
## Test Structure
6
+
7
+
```
8
+
test-compatibility/
9
+
├── react-18/ # React 18 test environment
10
+
├── react-19/ # React 19 test environment
11
+
├── shared-test.tsx # Shared test component
12
+
├── automated-test.js # Automated test runner
13
+
└── run-tests.sh # Manual test runner
14
+
```
15
+
16
+
## Running Tests
17
+
18
+
### Automated Test (Recommended)
19
+
20
+
This will build both React 18 and 19 test apps and verify they build without errors:
21
+
22
+
```bash
23
+
cd test-compatibility
24
+
node automated-test.js
25
+
```
26
+
27
+
Expected output:
28
+
```
29
+
✅ React 18: PASS
30
+
✅ React 19: PASS
31
+
🎉 All tests passed! The library is compatible with both React 18 and 19.
32
+
```
33
+
34
+
### Manual Interactive Test
35
+
36
+
This will start development servers for both React versions so you can test interactively:
37
+
38
+
```bash
39
+
cd test-compatibility
40
+
./run-tests.sh
41
+
```
42
+
43
+
This will:
44
+
- Start React 18 test on http://localhost:5173
45
+
- Start React 19 test on http://localhost:5174
46
+
47
+
Open both URLs in your browser and verify:
48
+
- ✅ Green box = No errors (working correctly)
49
+
- ❌ Red box = Error detected (needs fixing)
50
+
51
+
## What Was Fixed
52
+
53
+
The original error with React 18 was:
54
+
```
55
+
TypeError: Cannot read properties of undefined (reading 'recentlyCreatedOwnerStacks')
56
+
```
57
+
58
+
This was caused by the library bundling React's development JSX runtime, which includes debugging code that accesses `recentlyCreatedOwnerStacks` - a property that exists in React 19 but not in React 18.
59
+
60
+
The fix involved:
61
+
1. Changing the export pattern to avoid issues with JSX transform
62
+
2. Configuring Vite to externalize the JSX runtime and force production mode
63
+
3. This ensures the library uses the consumer's React version
64
+
65
+
## Verification
66
+
67
+
Both test environments import the built library and render a picker component. If the component renders without errors in both React 18 and 19, the compatibility issue is resolved.
0 commit comments