mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
24 lines
462 B
TypeScript
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
|
|
/>
|
|
);
|
|
}
|