diff --git a/ts/components/Checkbox.tsx b/ts/components/Checkbox.tsx index 32d0d040b223..b67315604695 100644 --- a/ts/components/Checkbox.tsx +++ b/ts/components/Checkbox.tsx @@ -1,7 +1,8 @@ // Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import React from 'react'; +import React, { useMemo } from 'react'; +import { v4 as uuid } from 'uuid'; import { getClassNamesFor } from '../util/getClassNamesFor'; @@ -25,6 +26,7 @@ export const Checkbox = ({ onChange, }: PropsType): JSX.Element => { const getClassName = getClassNamesFor('Checkbox', moduleClassName); + const id = useMemo(() => `${name}::${uuid()}`, [name]); return (
@@ -32,13 +34,14 @@ export const Checkbox = ({ onChange(ev.target.checked)} type="checkbox" />
- +
{description}