Open dilipchandima opened 10 months ago
@dilipchandima Facing this on a project where I have to maintain an older version of react native (0.63) that includes this package. This error is only appearing for us on REAL devices (not in simulator), running ios 17 (17.0.1); this is hard to reproduce. Any luck?
got same issue on simulator. any solution?
Hello! I'm looking to archive this project as I haven't been actively working with react-native for a while now. I recommend using https://callstack.github.io/react-native-paper/docs/components/Menu/ for the menu. It was once based on my project some time ago.
go to Menu Component in react native material menu, you will find this code,
react_native_1.Animated.timing(this.state.menuSizeAnimation, { toValue: { x: width, y: height }, duration: this.props.animationDuration, easing: EASING, useNativeDriver: false, }), react_native_1.Animated.timing(this.state.opacityAnimation, { toValue: 1, duration: this.props.animationDuration, easing: EASING, useNativeDriver: false, }),
replace it with
this.setState({ menuSizeAnimation: new react_native_1.Animated.ValueXY({ x: width, y: height }), opacityAnimation: new react_native_1.Animated.Value(1), })
it will be resolved and working then
Go to node_modules > react-native-material-menu > src > Menu.js:
Replace the _onMenuLayout
function with this :
_onMenuLayout = (e) => {
if (this.state.menuState === STATES.ANIMATING) {
return;
}
const { width, height } = e.nativeEvent.layout;
this.setState(
{
menuState: STATES.ANIMATING,
menuWidth: width,
menuHeight: height,
},
() => {
this.setState({
menuSizeAnimation: new Animated.ValueXY({ x: width, y: height }),
opacityAnimation: new Animated.Value(1),
})
},
);
};
Thanks @haider792 I have added more context to your comment.
This is the error log