Skip to content
Permalink
Browse files

Update GiftedChat.js

  • Loading branch information...
xcarpentier committed Dec 15, 2017
1 parent 6a7c4bd commit 528aa0e6abc1d17b1500203003e02c9520d830cb
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/GiftedChat.js
@@ -84,14 +84,14 @@ class GiftedChat extends React.Component {
if (!Array.isArray(messages)) {
messages = [messages];
}
return this.inverted ? messages.concat(currentMessages) : currentMessages.concat(messages);
return this.props.inverted ? messages.concat(currentMessages) : currentMessages.concat(messages);

This comment has been minimized.

Copy link
@ngothanhtai

ngothanhtai Dec 18, 2017

@xcarpentier: how can we use this inside a static function?

This comment has been minimized.

Copy link
@xcarpentier

xcarpentier Dec 18, 2017

Author Collaborator

Yes you are right... I’ve not seen that!

But this commit is just a fix of getting inverted from props...

this.inverted was already there before.

We need to figures out how to fix it... do you have any suggestion?

This comment has been minimized.

Copy link
@xcarpentier

xcarpentier Dec 18, 2017

Author Collaborator

@ngothanhtai I changed it by passing it to params with true as default value

This comment has been minimized.

Copy link
@ngothanhtai

ngothanhtai Dec 18, 2017

That's OK to add parameter with default value. Thanks @xcarpentier :)

}

static prepend(currentMessages = [], messages) {
if (!Array.isArray(messages)) {
messages = [messages];
}
return this.inverted ? currentMessages.concat(messages) : messages.concat(currentMessages);
return this.props.inverted ? currentMessages.concat(messages) : messages.concat(currentMessages);
}

getChildContext() {

0 comments on commit 528aa0e

Please sign in to comment.
You can’t perform that action at this time.