React-Native - native-base - use-subscription could not be found within the project

Viewed 45

I'm using native-base third party in the react-native project. I'm getting the below error :

error: Error: Unable to resolve module use-subscription from node_modules/native-base/src/core/color-mode/hooks.tsx: use-subscription could not be found within the project or in these directories:
  node_modules/native-base/node_modules
  node_modules
   8 | import type { IHybridContextProps } from './../hybrid-overlay/types';
   9 | import { AppState, useColorScheme as _useColorScheme } from 'react-native';
> 10 | import { useSubscription } from 'use-subscription';
     |                                  ^
  11 |
  12 | export const useColorMode = (): IColorModeContextProps => {
  13 |   const {
    at ModuleResolver.resolveDependency (/Users/admin/Nensi/react-nativeProjects/FPG/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:178:15)
    at DependencyGraph.resolveDependency (/Users/admin/Nensi/react-nativeProjects/FPG/node_modules/metro/src/node-haste/DependencyGraph.js:264:43)
    at Object.resolve (/Users/admin/Nensi/react-nativeProjects/FPG/node_modules/metro/src/lib/transformHelpers.js:170:21)

below is the version used in the project:

"native-base": "^3.4.14",
"react": "18.1.0",
"react-native": "0.70.0",

I am getting the same error in android and ios both.

Any help! Thank you in advance!

1 Answers

Downgrade your native base version to 3.5.0-alpha.8

Related