Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Example extends React.Component<
Props,
State,
Snapshot
> {
static getDerivedStateFromProps(
nextProps: Props,
prevState: State
): $Shape<State> | null {
// ...
}
getSnapshotBeforeUpdate(
prevProps: Props,
prevState: State
): Snapshot {
// ...
}
}
@geekf

This comment has been minimized.

Copy link

commented Mar 28, 2018

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

@theneva

This comment has been minimized.

Copy link

commented Mar 28, 2018

@geekf it's Flow

@simonbuchan

This comment has been minimized.

Copy link

commented Jul 2, 2018

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

@devCola

This comment has been minimized.

Copy link

commented Jul 10, 2018

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

@oshalygin

This comment has been minimized.

Copy link

commented Jan 15, 2019

This is Flow

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.