Skip to content

Instantly share code, notes, and snippets.

Created March 27, 2018 23:29
  • Star 33 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
class Example extends React.Component<
> {
static getDerivedStateFromProps(
nextProps: Props,
prevState: State
): $Shape<State> | null {
// ...
prevProps: Props,
prevState: State
): Snapshot {
// ...
Copy link

geekf commented Mar 28, 2018

Stupid question, but is this TypeScript? The file extensions says .js.

Copy link

theneva commented Mar 28, 2018

@geekf it's Flow

Copy link

Replace $Shape with Partial and you have typescript, though.

Copy link

devCola commented Jul 10, 2018

@simonbuchan just wondering... will Flow and Typescript merge?

Copy link

This is Flow

Copy link

How to define Snapshot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment