diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-11-06 11:27:28 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-11-16 17:17:36 +0100 |
| commit | 88c0a52d7daa2d1dfd332c7fc1bf1fcabeccf132 (patch) | |
| tree | 6e8aa875ff771f84fd6131c99a0979c8c3346100 /gui/src/renderer/components/cell | |
| parent | 5febe973ff753f7df18559d6b82e3738a9190330 (diff) | |
| download | mullvadvpn-88c0a52d7daa2d1dfd332c7fc1bf1fcabeccf132.tar.xz mullvadvpn-88c0a52d7daa2d1dfd332c7fc1bf1fcabeccf132.zip | |
Forward ref into switch
Diffstat (limited to 'gui/src/renderer/components/cell')
| -rw-r--r-- | gui/src/renderer/components/cell/Input.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gui/src/renderer/components/cell/Input.tsx b/gui/src/renderer/components/cell/Input.tsx index 4a11791136..bfa47b6687 100644 --- a/gui/src/renderer/components/cell/Input.tsx +++ b/gui/src/renderer/components/cell/Input.tsx @@ -5,10 +5,13 @@ import { mediumText } from '../common-styles'; import { CellDisabledContext } from './Container'; import StandaloneSwitch from '../Switch'; -export function Switch(props: StandaloneSwitch['props']) { +export const Switch = React.forwardRef(function SwitchT( + props: StandaloneSwitch['props'], + ref: React.Ref<HTMLDivElement>, +) { const disabled = useContext(CellDisabledContext); - return <StandaloneSwitch disabled={disabled} {...props} />; -} + return <StandaloneSwitch forwardedRef={ref} disabled={disabled} {...props} />; +}); export const InputFrame = styled.div({ flexGrow: 0, |
