React-native-gifted-chat: Error: Undefined '_react3.default.PropType.func'

Created on 18 Jan 2018  Â·  5Comments  Â·  Source: FaridSafi/react-native-gifted-chat

Issue Description

React native Undefined is not an object(evaluating'_react3.default.PropType.func')

Solution

1) Check your version of react, If the version is > 16 then propTypes is inside a new package called prop-types
see : https://www.npmjs.com/package/prop-types

2) Then,
Add: import PropTypes from 'prop-types'
Change: React.PropTypes.... => PropTypes....

need-more-info wontfix

Most helpful comment

Hi,

First of all I like to mentioned that what you’ve done with Gifted Chat package is amazing and saves me a whole lot of development time!!
Yes it is not directly related to the package, but when I tried to use ‘Slack example’ it is giving me that error and I have to change the way propTypes declared. I didn’t know how to add this solution so I added it in issues.

Regards,

On Jan 18, 2018, 10:42 AM -0500, Xavier Carpentier notifications@github.com, wrote:

Hello @naytun,
This is not related to this package or I miss something?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

All 5 comments

Hello @naytun,
This is not related to this package or I miss something?

Hi,

First of all I like to mentioned that what you’ve done with Gifted Chat package is amazing and saves me a whole lot of development time!!
Yes it is not directly related to the package, but when I tried to use ‘Slack example’ it is giving me that error and I have to change the way propTypes declared. I didn’t know how to add this solution so I added it in issues.

Regards,

On Jan 18, 2018, 10:42 AM -0500, Xavier Carpentier notifications@github.com, wrote:

Hello @naytun,
This is not related to this package or I miss something?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Once this error is corrected, the Slack example fails to produce results similar to the demo images. As a matter of fact, clicking 'Send' does not render any messages.

For anyone looking at this issue: it's caused by React moving PropTypes out of the React library. You need to import the prop-types library.

https://www.npmjs.com/package/prop-types

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

inceptivetech picture inceptivetech  Â·  3Comments

arayaryoma picture arayaryoma  Â·  3Comments

yazhengwang picture yazhengwang  Â·  3Comments

xcxooxl picture xcxooxl  Â·  3Comments

emilkarl picture emilkarl  Â·  3Comments