dominicstop / react-native-ios-context-menu

A react-native component to use context menu's (UIMenu) on iOS 13/14+
MIT License
544 stars 25 forks source link

Compatibility w/ non-Expo projects #81

Open go-sean-go opened 10 months ago

go-sean-go commented 10 months ago

Starting in v2.x, is this project no longer compatible with non-Expo projects...?

What are the install/upgrade/etc steps required for projects that are not using Expo?

The docs do not explain it at current - other than to say it uses Expo-Modules, which is not familiar to non-Expo users (or at least not to me!).

nandorojo commented 10 months ago

Hey, agreed that the docs should explain this better.

This link should explain it. TLDR: npx install-expo-modules@latest should be all you need.

crusherblack commented 4 months ago

Hi I already tried it using install-expo-modules based on @nandorojo recommendations

Follow this step

npx install-expo-modules

Install babel transform-export-namespace

yarn add @babel/plugin-transform-export-namespace-from --dev

update your babel.config.js

module.exports = {
  presets: ['module:@react-native/babel-preset'],
  plugins: ['@babel/plugin-transform-export-namespace-from'],
};

And it work on React Native CLI 0.74.1

image