Skip to content

Commit 6ec35c7

Browse files
authored
Add another comment to PureComponent example
1 parent ff9dc0b commit 6ec35c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/blog/2018-06-07-when-to-use-derived-state.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ class Example extends PureComponent {
322322
};
323323

324324
render() {
325+
// The render method on this PureComponent is not called unless either
326+
// props.list or state.filterText have referentially different values.
325327
const filteredList = this.props.list.filter(
326328
item => item.text.includes(this.state.filterText)
327329
)

0 commit comments

Comments
 (0)