Dan Abramov
7 years ago
committed by
GitHub
4 changed files with 17 additions and 22 deletions
@ -0,0 +1,5 @@ |
|||
class Example extends React.Component { |
|||
static getDerivedStateFromProps(nextProps, prevState) { |
|||
// ...
|
|||
} |
|||
} |
@ -0,0 +1,5 @@ |
|||
class Example extends React.Component { |
|||
getSnapshotBeforeUpdate(prevProps, prevState) { |
|||
// ...
|
|||
} |
|||
} |
@ -1,19 +0,0 @@ |
|||
class Example extends React.Component< |
|||
Props, |
|||
State, |
|||
Snapshot |
|||
> { |
|||
static getDerivedStateFromProps( |
|||
nextProps: Props, |
|||
prevState: State |
|||
): $Shape<State> | null { |
|||
// ...
|
|||
} |
|||
|
|||
getSnapshotBeforeUpdate( |
|||
prevProps: Props, |
|||
prevState: State |
|||
): Snapshot { |
|||
// ...
|
|||
} |
|||
} |
Loading…
Reference in new issue