proptypes render Error
Closed this issue · 6 comments
hey guys
i added this package in a pure react-native project that created by react-native-cli .
and after run i get this error ! in android and IOS
undefined is not an object (evaluating '_reactNative.Text.prototype.render')
this is my app Code:
`import React, { Component } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
import {
setCustomView,
setCustomTextInput,
setCustomText,
setCustomImage,
setCustomTouchableOpacity
} from "react-native-global-props";
const customTextProps = {
style: {
fontSize: 20,
fontFamily: Platform.OS === "ios" ? "HelveticaNeue" : "Roboto",
color: "red"
}
};
setCustomText(customTextProps);
const instructions = Platform.select({
ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
android:
"Double tap R on your keyboard to reload,\n" +
"Shake or press menu button for dev menu"
});
export default class App extends Component {
render() {
return (
Welcome to React Native!
To get started, edit App.js
{instructions}
);
}
}
`
and package.json:
"dependencies": { "prop-types": "^15.6.2", "react": "16.5.0", "react-native": "0.57.0", "react-native-global-props": "^1.1.4" }, "devDependencies": { "babel-jest": "23.6.0", "jest": "23.6.0", "metro-react-native-babel-preset": "0.48.0", "react-test-renderer": "16.5.0" }
Any one know the solution?
I find a fix been added for this error on commit dd3f676 , still i don't have this fix with npm install .
i'm using version 1.1.4 , but in node_modules , react-native-global-props packages , did't get changes !
@mr-riiim Does the package.json in your node_modules/react-native-global-props say 1.1.3?
@Ajackster i'm using version 1.1.3. Facing this same issue.
@mr-riiim Did you manage to get it work?
@mr-riiim It works after changing to this in package.json.
"react-native-global-props": "Ajackster/react-native-global-props#master",
@Ajackster I guess some problem with update. Please look into it.
Will do, thanks guys
react-native-global-props v 1.1.5 should fix this.