Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import React, {Component} from "react";
const initialState = Object.freeze({ count: 0 })
const defaultProps = Object.freeze({name: "John Doe"})
type State = typeof initialState;
type Props = { someProps: string } & typeof defaultProps;
class Counter extends Component<Props, State> {
static readonly defaultProps = defaultProps;
readonly state = {count: 0}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment