Comments (13)
Hi @filiptronicek, thanks for providing all the details. I will check these as soon as possible. 👍🏽
from react-native-hold-menu.
I forgot to use
import { HoldMenuProvider } from 'react-native-hold-menu'
<HoldMenuProvider>
...
</HoldMenuProvider>
now it works
from react-native-hold-menu.
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)
Stack trace
node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError
node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error
node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException
node_modules\react-native\Libraries\Core\ReactFiberErrorDialog.js:43:2 in showErrorDialog
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15257:32 in logCapturedError
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15361:20 in logError
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:16597:12 in update.callback
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7106:2 in callCallback
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7127:20 in commitUpdateQueue
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15801:25 in commitLifeCycles
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18744:22 in commitLayoutEffects
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:265:4 in invokeGuardedCallbackImpl
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:476:2 in invokeGuardedCallback
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18483:29 in commitRootImpl
[native code]:null in commitRootImpl
node_modules\scheduler\cjs\scheduler.development.js:653:23 in unstable_runWithPriority
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18317:17 in commitRoot
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:17697:12 in performSyncWorkOnRoot
[native code]:null in performSyncWorkOnRoot
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5321:31 in runWithPriority$argument_1
node_modules\scheduler\cjs\scheduler.development.js:653:23 in unstable_runWithPriority
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5316:21 in flushSyncCallbackQueueImpl
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5304:28 in flushSyncCallbackQueue
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:17741:26 in flushSync
node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:6154:13 in scheduleRefresh
node_modules\react-refresh\cjs\react-refresh-runtime.development.js:218:8 in mountedRoots.forEach$argument_0
[native code]:null in forEach
node_modules\react-refresh\cjs\react-refresh-runtime.development.js:210:4 in performReactRefresh
node_modules\react-native\Libraries\Core\setUpReactRefresh.js:43:6 in Refresh.performReactRefresh
node_modules\metro\src\lib\polyfills\require.js:627:10 in setTimeout$argument_0
node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
node_modules\react-native\Libraries\Core\Timers\JSTimers.js:383:16 in callTimers
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
[native code]:null in callFunctionReturnFlushedQueue
...
from react-native-hold-menu.
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;
from react-native-hold-menu.
What version of Reanimated are you using? There should be no error with the latest release, "react-native-reanimated": "2.1.0"
from react-native-hold-menu.
I'm using the 2.1.0
. I'm not sure what is the problem here
from react-native-hold-menu.
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.
from react-native-hold-menu.
@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
from react-native-hold-menu.
any updates?
from react-native-hold-menu.
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?
from react-native-hold-menu.
@enesozturk I still am, just checked with my iPhone XS running iOS 15.3 (tried the provided Expo Snack with the Expo Go app)
from react-native-hold-menu.
Same error here
from react-native-hold-menu.
from react-native-hold-menu.
Related Issues (20)
- With `Expo-router`, `HoldItem` clicked moves the height of the header HOT 2
- `undefined is not a function` HOT 1
- If menu items do not have unique names keys are not updating HOT 3
- Exposes a `key` value for `MenuItemProps` menu items that are identical other than their `onPress` function are approriately re-rendered HOT 2
- Expo 49 - Breaking Changes HOT 18
- item.onPress.apply is not a function HOT 1
- HoldItem causing entire component to re-render HOT 7
- Bottom item is too short HOT 1
- Menu displays behind modal screen HOT 1
- Expo Managed app support HOT 1
- `HoldItem` react context is incorrect HOT 2
- Position of element doesn't take header and other content into account HOT 1
- Doesn't expire cached items prop with arrow functions HOT 6
- v0.1.5 has many differences with main branch HOT 4
- It doesn't work combined with react-navigation on expo managed projects :(
- HoldMenuProvider crashes expo on reload HOT 3
- Padding Bug HOT 3
- Clashing dependencies
- Is project still maintained ? HOT 5
- v0.1.6 is not available on npmjs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-hold-menu.