Last active
July 14, 2019 22:34
-
-
Save benabdullah/736676b5344b189a4a97f16c04615e23 to your computer and use it in GitHub Desktop.
React-native-hr package, “undefined is not an object (evaluating PropTypes.shape) " Error Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* find index.js in node_modules/react-native-hr/dist and open with any code / text editor. | |
* after, add this lines and save file. | |
*/ | |
var _reactNative = require('react-native'); // existing code on line 13 | |
var _propTypes = require('prop-types'); // add this line, after _reactNative Variable | |
// finding Hr.propTypes Object and replace with | |
Hr.propTypes = { | |
lineStyle: _propTypes.shape({}), | |
text: _propTypes.string, | |
marginLeft: _propTypes.number, | |
marginRight: _propTypes.number, | |
textStyle: _propTypes.shape({}) | |
}; | |
// save file and enjoy ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brilliant!!