React-native-gifted-chat: Warning: Failed prop type: Invalid prop 'extraData' of type 'array' supplied to 'GiftedChat', expected 'object'.

Created on 7 Jun 2020  路  9Comments  路  Source: FaridSafi/react-native-gifted-chat

Issue Description

Warning: Failed prop type: Invalid prop 'extraData' of type 'array' supplied to 'GiftedChat', expected 'object'.

Here is my extraData :
extraData={[this.dataChat, index]}

When i put an object like this :
extraData={{dataChat : this.dataChat, index : index}}
I get the reverse warning :
Warning: Failed prop type: Invalid prop 'extraData' of type 'object' supplied to 'GiftedChat', expected 'array'.

Additional Information

  • Nodejs version: [FILL THIS OUT]
  • React version: 16.8.3
  • React Native version: 0.59.4
  • react-native-gifted-chat version: 0.16.1
  • Platform(s) (iOS, Android, or both?): Android
  • TypeScript version: [FILL THIS OUT]

Most helpful comment

Same issue.
I'll tell you more, guys. When passing array getting "expected 'object'" warning. When passing object getting "expected 'array'". LOL

All 9 comments

Why did you change
static propTypes = {
...
extraData: PropTypes.object
...
}

to

static propTypes = {
...
extraData: PropTypes.array
...
}
in MessageContainer.tsx ?

same issue

Same issue.
I'll tell you more, guys. When passing array getting "expected 'object'" warning. When passing object getting "expected 'array'". LOL

@xcarpentier could you look at this problem ?

Same issue.
I'll tell you more, guys. When passing array getting "expected 'object'" warning. When passing object getting "expected 'array'". LOL

LOL

Same issue.
I'll tell you more, guys. When passing array getting "expected 'object'" warning. When passing object getting "expected 'array'". LOL

I'm getting the example same issue, it's driving me nuts lol

Same issue.
I'll tell you more, guys. When passing array getting "expected 'object'" warning. When passing object getting "expected 'array'". LOL

Why am I still getting this issue on "react-native-gifted-chat": "^0.16.3" ? Please help

The fix has not been published to NPM yet as 0.16.3 predates the PR

will this be published to npm ? what is the proper way to silent this warning until then ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamdurui picture iamdurui  路  3Comments

arayaryoma picture arayaryoma  路  3Comments

Fr33maan picture Fr33maan  路  3Comments

redwind picture redwind  路  3Comments

xcxooxl picture xcxooxl  路  3Comments