proptypes render Error
See original GitHub issuehey 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 ( <View style={styles.container}> <Text style={styles.welcome}>Welcome to React Native!</Text> <Text style={styles.instructions}>To get started, edit App.js</Text> <Text style={styles.instructions}>{instructions}</Text> </View> ); } } `
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?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
@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.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 !