首页 > 解决方案 > 自定义库的输入/自动完成建议未出现在 Expo 项目中

问题描述

我用 Typescript 和 React Native 制作了一个库,并在 npm 上发布了它,但是当我在任何 expo 项目中使用它时,我没有收到任何打字或自动完成建议。谁能告诉我解决这个问题的步骤?另外,我使用 Callstack react-native-builder-bob 来设置这个库。

我现在的 tsconfig 是:

{
  "compilerOptions": {
    "baseUrl": ".",
    "declaration": true,
    "paths": {
      "my-library": ["./src/index"]
    },
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "esModuleInterop": true,
    "importsNotUsedAsValues": "error",
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "lib": ["esnext", "dom"],
    "module": "esnext",
    "moduleResolution": "node",
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noStrictGenericChecks": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "esnext"
  }
}


标签: exporeact-native-androidreact-native-iostypescript-typingscallstack

解决方案


推荐阅读