Skip to content

Instantly share code, notes, and snippets.

@lawrenceagles
Created Jan 4, 2022
Embed
What would you like to do?
// Don't do
type State = {count: number}
type Props = {}
class Counter extends Component<Props, State> {
constructor(props:Props){
super(props);
this.state = {count: 0}
}
}
// Do
type State = {count: number}
type Props = {}
class Counter extends Component<Props, State> {
state = {count: 0}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment