Skip to content

Instantly share code, notes, and snippets.

@benabdullah
Last active July 14, 2019 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benabdullah/736676b5344b189a4a97f16c04615e23 to your computer and use it in GitHub Desktop.
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
/**
* 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 !
@o5shorioush
Copy link

Brilliant!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment