sendou.ink/app/components/RequiredHiddenInput.tsx
Kalle fef1ffc955
Design refresh + a bunch of stuff (#2864)
Co-authored-by: hfcRed <hfcred@gmx.net>
2026-03-19 17:51:42 +02:00

24 lines
462 B
TypeScript

import styles from "./RequiredHiddenInput.module.css";
export function RequiredHiddenInput({
value,
isValid,
name,
}: {
value: string;
isValid: boolean;
name: string;
}) {
return (
<input
className={styles.input}
name={name}
value={isValid ? value : []}
// empty onChange is because otherwise it will give a React error in console
// readOnly can't be set as then validation is not active
onChange={() => null}
required
/>
);
}