Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class MultiSelect extends Component {
}
}

shouldComponentUpdate(nextProps) {
shouldComponentUpdate(nextProps, nextState) {
// This is a performance check as this sometimes gets updated often
if (nextProps.selectedOptions.length === this.props.selectedOptions.length) {
if (nextProps.selectedOptions === this.props.selectedOptions &&
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this if look like this please:

if (
  (variable === variable) &&
  (varible1 === variable1)
) {
  // do things here
}

I prefer this more verbose option for multiline stuff

nextState.selectedRows === this.state.selectedRows) {
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ list.
A React Native style object, you can also pass StyleSheet styles to this; they
will be flattened.

## `listViewProps{}`
### `listViewProps{}`
An object of props that are given to the ListView, this for things like `renderHeader`

### `activeOpacity` `Number`
Expand Down