Open kacperkwapisz opened 3 years ago
What version of Reanimated are you using? There should be no error with the latest release, "react-native-reanimated": "2.1.0"
I'm using the 2.1.0
. I'm not sure what is the problem here
Hi @kacperkwapisz, is the problem still exist? If yes could you provide more details how did you used the Hold Menu with code snippets, provide versions and other details in issue template.
@enesozturk, I think I might be getting the same problem as @kacperkwapisz on iOS, which is undefined is not an object (evaluating 'O.state')
. This is my package.json
:
{
"dependencies": {
"react-native-paper": "3.6.0",
"expo-constants": "~10.1.3",
"react-native-hold-menu": "*",
"react-native-reanimated": "~2.1.0",
"expo-blur": "~9.0.3",
"react-native-gesture-handler": "~1.10.2"
}
}
This is my App.js:
import React from 'react';
import { View } from 'react-native';
import { HoldItem } from 'react-native-hold-menu';
const MenuItems = [
{ text: 'Actions', icon: 'home', isTitle: true, onPress: () => {} },
{ text: 'Action 1', icon: 'edit', onPress: () => {} },
{ text: 'Action 2', icon: 'map-pin', withSeparator: true, onPress: () => {} },
{ text: 'Action 3', icon: 'trash', isDestructive: true, onPress: () => {} },
];
const Example = () => {
return (
<HoldItem
items={[
{ text: 'Actions', isTitle: true, onPress: () => {} },
{ text: 'Reply', onPress: () => {} },
{ text: 'Edit', onPress: () => {} },
{ text: 'Delete', onPress: () => {} },
]}
/>
);
};
export default Example;
This is an Expo snack as a demo: https://snack.expo.io/@filiptronicek/react-native-hold-menu-bug
When I ran this locally with Expo, this error I got seems to be the exact same as @kacperkwapisz!
TypeError: undefined is not an object (evaluating '_useInternal.state')
This error is located at:
in HoldItemComponent (at App.js:10)
in RCTView (at View.js:34)
in View (at App.js:9)
in App (created by ExpoRoot)
in ExpoRoot (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in DevAppContainer (at AppContainer.js:121)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)
Hi @filiptronicek, thanks for providing all the details. I will check these as soon as possible. 👍🏽
any updates?
Hi guys, it's been a long time. I tried to reproduce the issue in both bare workflow and managed workflow by Expo but could not handle it. Anyone still having the issue?
@enesozturk I still am, just checked with my iPhone XS running iOS 15.3 (tried the provided Expo Snack with the Expo Go app)
Did you use the HoldMenuProvider
like in the docs?
import React from 'react';
import { HoldMenuProvider } from 'react-native-hold-menu';
const App = () => {
return (
<HoldMenuProvider theme="light">
{/* Your app components */}
</HoldMenuProvider>
);
};
export default App;
Same error here
I forgot to use
import { HoldMenuProvider } from 'react-native-hold-menu'
<HoldMenuProvider>
...
</HoldMenuProvider>
now it works
That's the only error showing up which won't allow me to use the react-native-hold-menu. Do you know how to fix this?
undefined is not an object (evaluating '_useInternal.state')