File tree Expand file tree Collapse file tree 9 files changed +17
-17
lines changed
HTML5ConstraintValidationAPI Expand file tree Collapse file tree 9 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ function hasErrors(errors: Errors) {
2929}
3030
3131function Form ( ) {
32- const email = useRef < HTMLInputElement | null > ( null ) ;
33- const password = useRef < HTMLInputElement | null > ( null ) ;
34- const passwordConfirm = useRef < HTMLInputElement | null > ( null ) ;
32+ const email = useRef < HTMLInputElement > ( null ) ;
33+ const password = useRef < HTMLInputElement > ( null ) ;
34+ const passwordConfirm = useRef < HTMLInputElement > ( null ) ;
3535
3636 const [ errors , setErrors ] = useState < Errors > ( {
3737 email : [ ] ,
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ function getInitialInputsState() {
6565}
6666
6767function Form ( { classes } : FormProps ) {
68- const form = useRef < FormWithConstraints | null > ( null ) ;
69- const password = useRef < HTMLInputElement | null > ( null ) ;
68+ const form = useRef < FormWithConstraints > ( null ) ;
69+ const password = useRef < HTMLInputElement > ( null ) ;
7070
7171 const [ inputs , setInputs ] = useState < InputsState > ( getInitialInputsState ( ) ) ;
7272 const [ signUpButtonDisabled , setSignUpButtonDisabled ] = useState ( false ) ;
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ async function isACommonPassword(password: string) {
3939}
4040
4141function Form ( ) {
42- const form = useRef < FormWithConstraints | null > ( null ) ;
43- const password = useRef < HTMLInputElement | null > ( null ) ;
42+ const form = useRef < FormWithConstraints > ( null ) ;
43+ const password = useRef < HTMLInputElement > ( null ) ;
4444
4545 const [ inputs , setInputs ] = useState ( {
4646 email : '' ,
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import './index.html';
66import './style.css' ;
77
88function Form ( ) {
9- const form = useRef < FormWithConstraints | null > ( null ) ;
10- const password = useRef < HTMLInputElement | null > ( null ) ;
9+ const form = useRef < FormWithConstraints > ( null ) ;
10+ const password = useRef < HTMLInputElement > ( null ) ;
1111
1212 async function handleChange ( { target } : React . ChangeEvent < HTMLInputElement > ) {
1313 await form . current ! . validateFields ( target ) ;
Original file line number Diff line number Diff line change @@ -39,9 +39,9 @@ function hasErrors(errors: Errors) {
3939}
4040
4141function Form ( ) {
42- const email = useRef < HTMLInputElement | null > ( null ) ;
43- const password = useRef < HTMLInputElement | null > ( null ) ;
44- const passwordConfirm = useRef < HTMLInputElement | null > ( null ) ;
42+ const email = useRef < HTMLInputElement > ( null ) ;
43+ const password = useRef < HTMLInputElement > ( null ) ;
44+ const passwordConfirm = useRef < HTMLInputElement > ( null ) ;
4545
4646 const [ errors , setErrors ] = useState < Errors > ( {
4747 email : [ ] ,
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ async function isACommonPassword(password: string) {
3737}
3838
3939function Form ( ) {
40- const form = useRef < FormWithConstraints | null > ( null ) ;
41- const password = useRef < HTMLInputElement | null > ( null ) ;
40+ const form = useRef < FormWithConstraints > ( null ) ;
41+ const password = useRef < HTMLInputElement > ( null ) ;
4242
4343 const [ inputs , setInputs ] = useState ( {
4444 email : '' ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ interface Props {
99}
1010
1111export function WizardFormStep1 ( props : Props ) {
12- const form = useRef < FormWithConstraints | null > ( null ) ;
12+ const form = useRef < FormWithConstraints > ( null ) ;
1313
1414 async function handleChange ( { target } : React . ChangeEvent < HTMLInputElement > ) {
1515 props . onChange ( target ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ interface Props {
1212}
1313
1414export function WizardFormStep2 ( props : Props ) {
15- const form = useRef < FormWithConstraints | null > ( null ) ;
15+ const form = useRef < FormWithConstraints > ( null ) ;
1616
1717 async function handleChange ( { target } : React . ChangeEvent < HTMLInputElement > ) {
1818 props . onChange ( target ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ interface Props {
1313}
1414
1515export function WizardFormStep3 ( props : Props ) {
16- const form = useRef < FormWithConstraints | null > ( null ) ;
16+ const form = useRef < FormWithConstraints > ( null ) ;
1717
1818 async function handleChange ( {
1919 target
You can’t perform that action at this time.
0 commit comments