Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@cuvent/react-native-context-menu-view
Advanced tools
Use native context menu views from React Native with gesture handler support.
Use native context menu functionality from React Native. On iOS 13+ this uses UIMenu
functionality, and on Android it uses a PopUpMenu
.
On iOS 12 and below, nothing happens. You may wish to do a Platform.OS === 'ios' && parseInt(Platform.Version, 10) <= 12
check, and add your own onLongPress
handler.
$ npm install react-native-context-menu-view --save
cd ios/
pod install
import ContextMenu from "react-native-context-menu-view";
const Example = () => {
return (
<ContextMenu
actions={[{ title: "Title 1" }, { title: "Title 2" }]}
onPress={(e) => {
console.warn(
`Pressed ${e.nativeEvent.name} at index ${e.nativeEvent.index}`
);
}}
>
<View style={styles.yourOwnStyles} />
</ContextMenu>
);
};
See example/
for basic usage.
title
Optional. The title above the popup menu.
actions
Array of { title: string, systemIcon?: string, destructive?: boolean, disabled?: boolean, inlineChildren?: boolean, children?: Array<ContextMenuAction> }
.
System icon refers to an icon name within SF Symbols.
Destructive items are rendered in red on iOS, and unchanged on Android.
Nested menus are supported on iOS only and result in nested UIMenu which can be optionally displayed inline.
onPress
Optional. When the popup is opened and the user picks an option. Called with { nativeEvent: { index, name } }
. When a nested action is selected the top level parent index is used for the callback.
onCancel
Optional. When the popop is opened and the user cancels.
previewBackgroundColor
Optional. The background color of the preview. This is displayed underneath your view. Set this to transparent (or another color) if the default causes issues.
FAQs
Use native context menu views from React Native with gesture handler support.
The npm package @cuvent/react-native-context-menu-view receives a total of 7 weekly downloads. As such, @cuvent/react-native-context-menu-view popularity was classified as not popular.
We found that @cuvent/react-native-context-menu-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.