mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 04:33:10 +00:00
16 lines
269 B
JavaScript
16 lines
269 B
JavaScript
// Before
|
|
class ExampleComponent extends React.Component {
|
|
// highlight-next-line
|
|
state = {};
|
|
|
|
// highlight-range{1-8}
|
|
componentWillMount() {
|
|
this.setState({
|
|
count: 0,
|
|
derivedValue: computeDerivedValue(
|
|
this.props
|
|
),
|
|
});
|
|
}
|
|
}
|