Skip to content

Commit

Permalink
[#34] Add key to react list
Browse files Browse the repository at this point in the history
The list cached the height while switching between applications.
We fix this with the use of the key property, that means that react will
not reuse the component and make a new one.

see https://reactjs.org/docs/reconciliation.html
  • Loading branch information
jmattheis committed Apr 13, 2018
1 parent e28a157 commit 9f5ed34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/src/pages/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class Messages extends Component {
{hasMessages
? (
<div style={{width: '100%'}}>
<ReactList ref={(el) => this.list = el}
<ReactList key={appId}
ref={(el) => this.list = el}
itemRenderer={this.renderMessage}
length={messages.length}
threshold={1000}
Expand Down

0 comments on commit 9f5ed34

Please sign in to comment.