Created
March 26, 2020 01:12
-
-
Save trblackw/1bf3c65576cca637338cc2408dfb2285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
const initialFormState = { | |
email: '', | |
password: '', | |
passwordConfirm: '' | |
} | |
const Register: React.FC = (): JSX.Element => { | |
const [form, setForm] = useState(initialFormState) | |
... | |
form.email = 2 // Error: type number is not assignable to type string (paraphrased error) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment