Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
event targets
Element
document
window
XMLHttpRequest
...
onchange={(e:FormEvent<HTMLInputElement>) => {
event.currentTarget
const v = e.target.value // property 'value' does not exit on type 'EventTarget'
}}
interface Props {
name?: string
}
class com extends Component<Props>() {
static defaultProps = {
name: 'xx'
}
render() {
console.log(this.props.name) //maybe undfined
}
}
const [name] = this.props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.