Skip to content

Commit 9511271

Browse files
gontardgaearon
authored andcommitted
fix link to anchor #unsafe_componentwillupdate (#920)
1 parent 3e87993 commit 9511271

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: content/docs/reference-react-component.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Use `shouldComponentUpdate()` to let React know if a component's output is not a
263263

264264
Returning `false` does not prevent child components from re-rendering when *their* state changes.
265265

266-
Currently, if `shouldComponentUpdate()` returns `false`, then [`UNSAFE_componentWillUpdate()`](#componentwillupdate), [`render()`](#render), and [`componentDidUpdate()`](#componentdidupdate) will not be invoked. Note that in the future React may treat `shouldComponentUpdate()` as a hint rather than a strict directive, and returning `false` may still result in a re-rendering of the component.
266+
Currently, if `shouldComponentUpdate()` returns `false`, then [`UNSAFE_componentWillUpdate()`](#unsafe_componentwillupdate), [`render()`](#render), and [`componentDidUpdate()`](#componentdidupdate) will not be invoked. Note that in the future React may treat `shouldComponentUpdate()` as a hint rather than a strict directive, and returning `false` may still result in a re-rendering of the component.
267267

268268
If you determine a specific component is slow after profiling, you may change it to inherit from [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) which implements `shouldComponentUpdate()` with a shallow prop and state comparison. If you are confident you want to write it by hand, you may compare `this.props` with `nextProps` and `this.state` with `nextState` and return `false` to tell React the update can be skipped.
269269

0 commit comments

Comments
 (0)