mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
13 lines
288 B
JavaScript
13 lines
288 B
JavaScript
// After
|
|
class ExampleComponent extends React.Component {
|
|
// highlight-range{1-8}
|
|
componentDidUpdate(prevProps, prevState) {
|
|
if (
|
|
this.state.someStatefulValue !==
|
|
prevState.someStatefulValue
|
|
) {
|
|
this.props.onChange(this.state.someStatefulValue);
|
|
}
|
|
}
|
|
}
|