diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index e8c04bc..356596c 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -5,9 +5,9 @@ runs: using: composite steps: - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version-file: .nvmrc + node-version: 'lts/*' - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d8c2a4..e2f9bcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 5397c87..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -16.18.1 diff --git a/README.md b/README.md index b80d303..bc31868 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,14 @@ You can fully customize what it renders inside of the `PlatformPressable` using ## Recipes +#### Closing the overflow menu from `overflowMenuPressHandlerDropdownMenu` manually + +`overflowMenuPressHandlerDropdownMenu` supports rendering custom items in the menu. In your item's onPress handler, you can call `closeMenu` to close the menu manually. + +```ts +const { closeMenu } = useOverflowMenu(); +``` + #### Customizing the overflow menu The default handler for overflow menu on iOS is `overflowMenuPressHandlerActionSheet`. diff --git a/example/index.js b/example/index.js new file mode 100644 index 0000000..1d6e981 --- /dev/null +++ b/example/index.js @@ -0,0 +1,8 @@ +import { registerRootComponent } from 'expo'; + +import App from './App'; + +// registerRootComponent calls AppRegistry.registerComponent('main', () => App); +// It also ensures that whether you load the app in Expo Go or in a native build, +// the environment is set up appropriately +registerRootComponent(App); diff --git a/example/package.json b/example/package.json index 5be5d68..b0c8e5e 100644 --- a/example/package.json +++ b/example/package.json @@ -15,20 +15,20 @@ "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", "@react-navigation/stack": "^6.3.16", - "expo": "~49.0.13", - "expo-splash-screen": "~0.20.5", - "expo-status-bar": "~1.6.0", + "expo": "~50.0.6", + "expo-splash-screen": "~0.26.4", + "expo-status-bar": "~1.11.1", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "0.72.5", - "react-native-gesture-handler": "~2.12.0", - "react-native-safe-area-context": "4.6.3", - "react-native-screens": "~3.22.0", + "react-native": "0.73.4", + "react-native-gesture-handler": "~2.14.0", + "react-native-safe-area-context": "4.8.2", + "react-native-screens": "~3.29.0", "react-native-web": "~0.19.6" }, "devDependencies": { "@babel/core": "^7.20.0", - "@expo/webpack-config": "^19.0.0", + "@expo/webpack-config": "~19.0.1", "babel-loader": "^8.1.0", "babel-plugin-module-resolver": "^4.1.0" }, diff --git a/example/src/screens/HomeScreen.tsx b/example/src/screens/HomeScreen.tsx index 1e44514..645a456 100644 --- a/example/src/screens/HomeScreen.tsx +++ b/example/src/screens/HomeScreen.tsx @@ -33,7 +33,7 @@ export function HomeScreen({ navigation }: ScreenProps<'HomeScreen'>) { const { toggleTheme } = React.useContext(ThemeContext); return ( - + Explore possible usages with: