From 63f46ebe9f9b90cfe62fe42b5907d60925ba5660 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 31 Aug 2022 17:56:47 -0700 Subject: [PATCH] InputRowRadioButtons types: Relax TItemKey to accept `number` And also for SelectableOptionsScreen, which this uses. These now match SelectableOptionRow, which has already been accepting `number`. --- src/common/InputRowRadioButtons.js | 4 +++- src/common/SelectableOptionsScreen.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/InputRowRadioButtons.js b/src/common/InputRowRadioButtons.js index 2adc7b8c80b..026c11cb0d0 100644 --- a/src/common/InputRowRadioButtons.js +++ b/src/common/InputRowRadioButtons.js @@ -68,7 +68,9 @@ type Props = $ReadOnly<{| // represented by IconRight. NestedNavRow would probably be the wrong // abstraction, though, because it isn't an imput component; it doesn't have // a value to display. -export default function InputRowRadioButtons(props: Props): Node { +export default function InputRowRadioButtons( + props: Props, +): Node { const { navigation, label, description, valueKey, items, onValueChange } = props; const screenKey: string = useRef(`selectable-options-${randString()}`).current; diff --git a/src/common/SelectableOptionsScreen.js b/src/common/SelectableOptionsScreen.js index 04193aa8b33..4b1e11b4c4d 100644 --- a/src/common/SelectableOptionsScreen.js +++ b/src/common/SelectableOptionsScreen.js @@ -78,7 +78,9 @@ LogBox.ignoreLogs([/selectable-options > params\.onRequestSelectionChange \(Func // If we need separate components dedicated to checkboxes and radio buttons, // we can split this. Currently it's up to the caller to enforce the // radio-button invariant (exactly one item selected) if they want to. -export default function SelectableOptionsScreen(props: Props): Node { +export default function SelectableOptionsScreen( + props: Props, +): Node { const { route } = props; const { title, description, items, onRequestSelectionChange } = route.params;