diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-09-09 18:53:47 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-09-09 18:53:47 +0200 |
| commit | ec2b5ce1891e92866f4263018a3e0cebe6091ff0 (patch) | |
| tree | 31b8dff9bd83a5fbf5665acbf289882efd75dfe1 /gui/src | |
| parent | 5c59821ecf95bbaea1431e1b74fe730d67bb3054 (diff) | |
| download | mullvadvpn-ec2b5ce1891e92866f4263018a3e0cebe6091ff0.tar.xz mullvadvpn-ec2b5ce1891e92866f4263018a3e0cebe6091ff0.zip | |
Forward ref in Cell.Switch
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/renderer/components/Cell.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gui/src/renderer/components/Cell.tsx b/gui/src/renderer/components/Cell.tsx index c2f5e633bf..397b7513a0 100644 --- a/gui/src/renderer/components/Cell.tsx +++ b/gui/src/renderer/components/Cell.tsx @@ -237,13 +237,16 @@ export const Label = function CellLabel(props: ILabelProps) { ); }; -export const Switch = function CellSwitch(props: SwitchControl['props']) { +export const Switch = React.forwardRef(function CellSwitch( + props: SwitchControl['props'], + ref?: React.Ref<SwitchControl>, +) { return ( <View style={styles.switch}> - <SwitchControl {...props} /> + <SwitchControl ref={ref} {...props} /> </View> ); -}; +}); interface IInputFrameProps { children?: React.ReactNode; @@ -264,7 +267,7 @@ export const Input = React.forwardRef(function CellInput( return ( <TextInput - ref={ref as any} + ref={ref} placeholderTextColor={colors.white60} autoCorrect={false} style={[styles.input.text, style]} |
