Skip to content

Commit 63f46eb

Browse files
committed
InputRowRadioButtons types: Relax TItemKey to accept number
And also for SelectableOptionsScreen, which this uses. These now match SelectableOptionRow, which has already been accepting `number`.
1 parent 7ee4bd4 commit 63f46eb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/common/InputRowRadioButtons.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ type Props<TItemKey> = $ReadOnly<{|
6868
// represented by IconRight. NestedNavRow would probably be the wrong
6969
// abstraction, though, because it isn't an imput component; it doesn't have
7070
// a value to display.
71-
export default function InputRowRadioButtons<TItemKey: string>(props: Props<TItemKey>): Node {
71+
export default function InputRowRadioButtons<TItemKey: string | number>(
72+
props: Props<TItemKey>,
73+
): Node {
7274
const { navigation, label, description, valueKey, items, onValueChange } = props;
7375

7476
const screenKey: string = useRef(`selectable-options-${randString()}`).current;

src/common/SelectableOptionsScreen.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ LogBox.ignoreLogs([/selectable-options > params\.onRequestSelectionChange \(Func
7878
// If we need separate components dedicated to checkboxes and radio buttons,
7979
// we can split this. Currently it's up to the caller to enforce the
8080
// radio-button invariant (exactly one item selected) if they want to.
81-
export default function SelectableOptionsScreen<TItemKey: string>(props: Props<TItemKey>): Node {
81+
export default function SelectableOptionsScreen<TItemKey: string | number>(
82+
props: Props<TItemKey>,
83+
): Node {
8284
const { route } = props;
8385
const { title, description, items, onRequestSelectionChange } = route.params;
8486

0 commit comments

Comments
 (0)