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
The `LookupField` component now uses TypeScript discriminated unions based on the `infinite` and `multiple` props. This provides better type inference and catches invalid prop combinations at compile time.
19
+
20
+
#### `onQueryPage` replaces `onQuery` for infinite mode
17
21
18
22
When using `LookupField` with `infinite: true`, you must now use the `onQueryPage` prop instead of `onQuery`.
19
-
This change improves TypeScript type inference by providing distinct callback signatures for standard and infinite modes.
20
23
21
24
**Before:**
22
25
```tsx
@@ -44,6 +47,17 @@ The `onQuery` prop now only accepts a string query parameter for standard (non-i
44
47
45
48
**Backwards Compatibility:** The runtime includes a compatibility shim that copies `onQuery` to `onQueryPage` when `infinite: true` is set. This allows existing code to continue working, but TypeScript will report type errors. We recommend updating your code to use the new API.
46
49
50
+
#### `pageSize` is now exclusive to infinite mode
51
+
52
+
The `pageSize` prop is now only available when `infinite: true`. If you were using `pageSize` without `infinite`, remove it as it had no effect.
53
+
54
+
#### Props are now discriminated by `multiple`
55
+
56
+
- When `multiple: true`: use `records` and/or `values` props
57
+
- When `multiple` is not set or `false`: use `value` and `text` props
58
+
59
+
TypeScript will now report errors if you mix props from different modes (e.g., using `value` with `multiple: true`).
0 commit comments