mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Added gDSFP to example
This commit is contained in:
@@ -5,6 +5,18 @@ class ExampleComponent extends React.Component {
|
||||
subscribedValue: this.props.dataSource.value,
|
||||
};
|
||||
// highlight-line
|
||||
// highlight-range{1-10}
|
||||
static getDerivedStateFromProps(nextProps, prevState) {
|
||||
if (
|
||||
prevState.subscribedValue !==
|
||||
nextProps.dataSource.value
|
||||
) {
|
||||
return {
|
||||
subscribedValue: nextProps.dataSource.value,
|
||||
};
|
||||
}
|
||||
}
|
||||
// highlight-line
|
||||
// highlight-range{1-3}
|
||||
componentDidMount() {
|
||||
this.finalizeSubscription();
|
||||
|
||||
Reference in New Issue
Block a user