mxck / react-native-material-menu

Pure JavaScript material menu component for React Native
MIT License
512 stars 91 forks source link

Cannot use MenuItem with RN 0.62 #86

Closed pnthach95 closed 4 years ago

pnthach95 commented 4 years ago
TypeError: undefined is not an object (evaluating '_reactNative.TouchableHighlight.propTypes.style')

In RN 0.62, they removed propTypes from TouchableHighlight, so it broke.

MujtabaFR commented 4 years ago

I'm having the same issue with RN 0.62 and react-native-material-menu 1.0.0

- breaking changes in RN 0.62 :

Remove PropTypes: We're removing propTypes from core components in order to reduce the app size impact of React Native core and to favor static type systems which check at compile time instead of runtime.

For now, I removed TouchableHighlight.propTypes from my codes /node_modules/react-native-material-menu/src/MenuItem.js

lines 58-67

MenuItem.propTypes = {
  children: PropTypes.node.isRequired,
  disabled: PropTypes.bool,
  disabledTextColor: PropTypes.string,
  ellipsizeMode: PropTypes.string,
  onPress: PropTypes.func,
  // style: TouchableHighlight.propTypes.style,  <-- this
  textStyle: Text.propTypes.style,
  // underlayColor: TouchableHighlight.propTypes.underlayColor, <-- and this
};
mxck commented 4 years ago

I published 1.1.0 version without PropTypes at all :)