Create a gist now

Instantly share code, notes, and snippets.

Embed
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.

Show comment
Hide comment
@geekf

geekf Mar 28, 2018

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

geekf commented Mar 28, 2018

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

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva Mar 28, 2018

@geekf it's Flow

theneva commented Mar 28, 2018

@geekf it's Flow

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