Added gDSFP to example

This commit is contained in:
Brian Vaughn
2018-02-20 17:09:43 -08:00
parent 858c1a7511
commit 98d5a092af

View File

@@ -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();