Skip to content

Support node module resolution? #254

@stephentuso

Description

@stephentuso

After updating to Expo 52 - I'm running into an issue where using NodeNext results in expo-router imports being typed as any (expo/expo#32850), and using the default node resolutions results in errors from this library as mentioned in the docs. This could be fixed by expo supporting NodeNext - but this is the only library I use that requires NodeNext and it seems likely to be fixed here faster than in Expo.

For now I'm using this patch, which also includes #253:

react-navigation-header-buttons+12.0.1.patch

diff --git a/node_modules/react-navigation-header-buttons/package.json b/node_modules/react-navigation-header-buttons/package.json
index 7a9307a..27133ef 100644
--- a/node_modules/react-navigation-header-buttons/package.json
+++ b/node_modules/react-navigation-header-buttons/package.json
@@ -2,6 +2,8 @@
   "name": "react-navigation-header-buttons",
   "version": "12.0.1",
   "description": "Easily render header buttons for react-navigation",
+  "main": "./lib/module/index.js",
+  "types": "./lib/typescript/index.d.ts",
   "exports": {
     ".": {
       "react-native": "./src/index.ts",
diff --git a/node_modules/react-navigation-header-buttons/src/providers/HeaderButtonsProviderPlain.ts b/node_modules/react-navigation-header-buttons/src/providers/HeaderButtonsProviderPlain.tsx
similarity index 100%
rename from node_modules/react-navigation-header-buttons/src/providers/HeaderButtonsProviderPlain.ts
rename to node_modules/react-navigation-header-buttons/src/providers/HeaderButtonsProviderPlain.tsx

and ts-ignore for the provider:

// @ts-ignore
import { HeaderButtonsProviderPlain } from "react-navigation-header-buttons/HeaderButtonsProviderPlain";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions