react-native-emoticons
react-native-emoticons copied to clipboard
Undefined is not an object (React.PropTypes.func)
I'm having the same problem:
I do not feel like changing the version of react native. There is another solution?
my version:
"react-native": "0.52.0"
this may be helpful for you https://reactjs.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes
@xiewang I was able to solve the problems. The library is already working fine with the latest version of react native (not the latest. and the 0.52).
I suggest changing the library so people do not have to reduce the version of react native.
The modified files were:
react-native-emoctions/package.json react-native-emoctions/tab.js
The modifications were:
In file react-native-emoctions/package.json
BEFORE
"react-native-scrollable-tab-view": "^0.6.7",
AFTER
"react-native-scrollable-tab-view": "^0.8.0",
"create-react-class": "^15.6.3", //new
In file react-native-emoctions/tab.js BEFORE
class TabBar extends React.Component {
...
static propTypes = {
goToPage: React.PropTypes.func,
activeTab: React.PropTypes.number,
tabs: React.PropTypes.array,
};
...
}
export default TabBar;
//AFTER
import PropTypes from 'prop-types';
class TabBar extends React.Component {
.....
}
TabBar.propTypes = {
goToPage: PropTypes.func,
activeTab: PropTypes.number,
tabs: PropTypes.array,
};
export default TabBar;
By changing the tab.js file to the new structure of PropTypes (external library) and updating and inserting the dependencies of the package.json file, the library works without errors.
You are correct. I just miss it. I'll fix it later. Thanks a lot.
@renatosistemasvc .Thank you. I apply the modification but I have the error ;Cannot read property 'type' of undefined
@WapiMukki Show me an error image. Or a console.log..
I'm using it without any problem. Show more details to find out what's happening.
You are correct. problem fix it. Thank you
even though react-native-scrollable-tab-view to latest problem still remaining.any guidance? thanks guys
still getting this error myself. anyone find a solution?
我用的0.55.4的版本,也出现这个错误。 安装时出现这个错误 npm WARN [email protected] requires a peer of eslint@^3.17.0 || ^ 4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse vents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} 应该是版本太低导致的
使用时出现这个错误! Undefined is not an object (React.PropTypes.func)
但是不知道怎么解决
I stumbled on this GH issue looking for a fix to this same error for a non-native ReactJS project. For what its's worth, I just "fixed" it by downgrading from "react": "^17.0.1"
to "react": "^15.4.1"
. I'm thinking it might be deeper than the react-native
package...