Skip to content

Instantly share code, notes, and snippets.

@JustinDFuller
Created October 13, 2018 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinDFuller/9aae67d963c92babfccd9aec5f1469c8 to your computer and use it in GitHub Desktop.
Save JustinDFuller/9aae67d963c92babfccd9aec5f1469c8 to your computer and use it in GitHub Desktop.
react component interface
interface ComponentLifecycle {
constructor(props: Object);
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Object, nextState: Object, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: ErrorInfo): void;
setState(
state: ((prevState: Object, props: Object) => Object,
callback?: () => void
): void;
render(): Object | null;
state: Object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment