Skip to content

Instantly share code, notes, and snippets.

@trblackw
Created March 26, 2020 01:12
Show Gist options
  • Save trblackw/1bf3c65576cca637338cc2408dfb2285 to your computer and use it in GitHub Desktop.
Save trblackw/1bf3c65576cca637338cc2408dfb2285 to your computer and use it in GitHub Desktop.
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