[#34] Add key to react list

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
This commit is contained in:
Jannis Mattheis 2018-04-09 17:11:58 +02:00 committed by Jannis Mattheis
parent e28a157122
commit 9f5ed344f4
1 changed files with 2 additions and 1 deletions

View File

@ -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}