Skip to content

Commit

Permalink
cast input handler fn as any in nextjs template
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieomaguire committed Feb 8, 2024
1 parent d0050c7 commit db5d02f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nextjs-app/src/pages/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default function Form() {
const [password, setPassword] = useState('');
const [passwordConfirmation, setPasswordConfirmation] = useState('');

const handleUsernameChange = (event: CustomEvent) => {
setUsername(event.detail?.sourceEvent?.target?.value || '');
};
const handleUsernameInput = (event: InputEvent) => {
setUsername((event.target as HTMLInputElement).value);
}

const handleEmailChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setEmail(event.target.value);
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function Form() {
data-test-id="username"
name="username"
value={username}
onChange={handleUsernameChange}
onInput={handleUsernameInput as any}
type="text"></PieInput>

<label htmlFor="email">
Expand Down

0 comments on commit db5d02f

Please sign in to comment.