Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
42 votes
6 answers
16k views

'Stack.Navigator' cannot be used as a JSX component

There is a type issue using react navigation, when use Stack.Navigation or Stack.Group from createNativeStackNavigator The issue saids that the types dont match with JSX.element at the end of the ...
Jerome Bravo's user avatar
28 votes
2 answers
3k views

Why does my React Native app build successfully despite TypeScript compiler error?

I've recently started using TypeScript with Expo. I've done all the linter/formatter integrations like typescript-eslint so I can catch most of the errors during coding. To check if the code compiles, ...
anar's user avatar
  • 585
21 votes
7 answers
23k views

Unable to use typescript with expo - "It looks like you're trying to use TypeScript but don't have the required dependencies installed"

I am receiving an error while trying to use Typescript with my existing expo project. While following the docs, I created a tsconfig.json file in the project root. When running expo start, I am ...
RossB's user avatar
  • 329
15 votes
1 answer
14k views

TypeScript types for TextInput's onChange event in React Native

I have a React Native Expo project using TypeScript. How can I add types for the onChange event for the TextInput? <TextInput keyboardType="numeric" value={`${value}`} ...
Evanss's user avatar
  • 23.7k
14 votes
1 answer
7k views

React-Native expo POST Blob

I'm using react native with expo and I'm trying to POST a blob image through fetch api. I'm using form-data format for the body and i have the next code: const blob = await response.blob() ...
Axel Ros's user avatar
  • 735
13 votes
4 answers
9k views

How to use @expo/vector-icons dynamically through props in typescript react native app?

react native app with typescript and I'm trying to create icon button that uses @expo/vector-icons with Fontawesome or MaterialIcon dynamically by trying to pass a name as a string via props. I think ...
Sheessai's user avatar
  • 135
13 votes
1 answer
5k views

React Navigation v6 NavigationContainer linking attribute with nested navigation typescript issue

I am using react navigation 6 with a root stack navigator containing a tab navigator. My linking attribute config looks like this in the App component: export default function App() { const ...
Smiter's user avatar
  • 1,197
11 votes
1 answer
4k views

How to avoid Typescript transpiling Jest __mocks__

I'm getting a warning from Jest for each manual mock I have, because it finds both the .ts and .js version of it and asks me to delete one, i.e.: jest-haste-map: duplicate manual mock found: ...
jhm's user avatar
  • 4,469
11 votes
1 answer
17k views

environment variables in babel.config.js

We need to modify certain configuration/variables in our React Native app (built using Expo) depending on environment (local/dev/staging/production). I've looked at a number of libraries meant for ...
Alexander Tsepkov's user avatar
10 votes
8 answers
28k views

React-Native File 'expo-module-scripsts/tsconfig.base' not found

my problem is like this // @generated by expo-module-scripts { "extends": "expo-module-scripts/tsconfig.base", "compilerOptions": { "outDir": "./...
Abdullah's user avatar
  • 117
10 votes
3 answers
8k views

cannot initiate expo bare workflow with typescript

I`m trying to initiate expo bare workflow with typescirpt. But after I type "expo init [project name]" in command window, I cannot find minimal(typescirpt) option. ? Choose a template: » - ...
seungjun's user avatar
  • 101
10 votes
7 answers
6k views

Receiving error while reqeusting notification permission on expo app

I Have a simple code that asks for notifications permission that worked in the past, but suddently,It's giving me this error: "Error: Encountered an exception while calling native method: ...
Lucas Gardini Dias's user avatar
9 votes
3 answers
3k views

How to utilize useContext in expo router?

I'm using the new Expo-Router version that uses a file based navigation I used React's context API + useReducer hook to create a universal language context in the app The problem is I have no idea ...
Abdullah Alharbi's user avatar
9 votes
1 answer
3k views

Expo: No native splash screen registered for provided activity. Please configure your application's main Activity to call 'SplashScreen.show'

Unhandled promise rejection: Error: No native splash screen registered for given view controller. Call 'SplashScreen.show' for given view controller first. (https://github.com/expo/expo/tree/main/...
Jhonata Bonadio's user avatar
8 votes
3 answers
8k views

expo delete permission location

I try to post my app on google play store, but they say I can't because I use location, but I never use it.. If I make an app-bundle and I open it with Android Studio, I find this on Manifest : [...] &...
samuel's user avatar
  • 487
8 votes
1 answer
6k views

How to ignore typescript errors in jest

how to ignore some typescript errors when running the tests with jest ? I have tried to use // @ts-ignore comment, but still not working for jest. I am using jest-expo which internally uses [email protected]....
Ehsan Sarshar's user avatar
7 votes
2 answers
2k views

React Navigation Typescript namespace not found

When I'm trying to create any navigator( tab/ stack/ drawer) I get this typescript error: Cannot find namespace 'Tab' even when it's defined in the file itself. What's the problem and what's the ...
Aakash Meshram's user avatar
7 votes
3 answers
5k views

Getting "Invalid call" when using require with Typescript and Expo

I am trying to play some audio in a react-native app created with the expo-cli. The code is written in typescript and the offending code looks like this, taken from the expo.io documentation: import * ...
morras's user avatar
  • 1,180
7 votes
2 answers
11k views

Typescript StackNavigatonProps and Screen props in react-navigation v5

What is the best way to define type for screen's navigation prop, when screen is in different file that router? Let's say I have one file, in which I define routes: //Router.tsx type ...
pafry's user avatar
  • 259
6 votes
2 answers
3k views

EAS build can't find aws-exports

I have an Expo project with AWS Amplify. I'm currently using EAS from Expo to deploy on mobile. Pretty often I run on this error: ❌ Metro encountered an error: Unable to resolve module ./src/aws-...
Felipe César's user avatar
6 votes
2 answers
2k views

React Native Text is not getting bounded by limits of container View

I am creating a react native expo app. In it, I want to create a 2 column layout. Content's title on the left and data on the right. <View> <Text>Some title</Text> <Text>...
Dracula's user avatar
  • 2,990
6 votes
2 answers
2k views

Error trying to access the error property of AVPlaybackStatus

I'm new to TypeScript and am trying to work with expo-av for audio playback. The following code gives me an error: TS2339: Property 'error' does not exist on type 'AVPlaybackStatus'. const { sound, ...
Reto Höhener's user avatar
6 votes
1 answer
6k views

Expo: Cannot resolve entry file: The `main` field defined in your `package.json` points to a non-existent path

I am working with the default typescript template generated from the command line npx create-expo-app -t expo-template-blank-typescript and I get this error when I try to start the project. The main ...
TOPKAT's user avatar
  • 7,989
6 votes
2 answers
4k views

Typed routes with object parameters on new Expo-Router v2

I am moving my app from react-navigation to expo-router, but I didn't find a solution to typed routes yet. I know there is a feature that automatically types your routes following the files routes and ...
Guilherme's user avatar
6 votes
1 answer
2k views

Firebase Cloud Function - Triggering Expo SDK to Push Notifications to Users

I am working on an app based of Expo - I decided to use firebase as a backend but had come up to a blocker, I need to send push notifications to the users in the app - but Expo doesn't work with ...
Sufiyaan Mitha's user avatar
5 votes
1 answer
30k views

Typescript: property "title" does not exist on type 'never'

I am practicing React-native typescript. I fetched the data from jsonplaceholer API and added to my component state. After mapping the state and try to render on my mobile. But I am getting typescript ...
juha's user avatar
  • 585
5 votes
3 answers
7k views

How to access expo-file-system Filesystem.documentDirectory

I am trying to do a data backup for my React Native App with expo go and expo-file-system await Filesystem.writeAsStringAsync( Filesystem.documentDirectory! + "GymTracker-Data.json", ...
Ryan's user avatar
  • 398
5 votes
2 answers
8k views

Unable to resolve module 'module://graphql/language/parser.js'

I am trying to make a React Native TypeScript project on Snack Expo. Although I have already added graphql in the package.json as well as the types file, I still get this error : Device: (1:8434) ...
user avatar
5 votes
1 answer
3k views

Metro bundler errors when using module-resolver

I've created a project using expo typescript template. Running on iOS and Android. No web. I then set up path alias in tsconfig.json as follows: "paths": { "@models/*": ["./src/models/*"], "@...
Jasper Blues's user avatar
  • 28.6k
5 votes
3 answers
4k views

Resolve error: webpack with invalid interface loaded as resolver after Expo upgrade to SDK 45

Since upgrading Expo SDK from 43 to 45, I am getting these ESLint errors in every file on the first import line. The project is able to run though. I've tried adding the eslint-import-resolver-...
Z0q's user avatar
  • 1,787
5 votes
1 answer
5k views

React navigation/native property doesn't exist on type props

I'm having troubles adding a prop to my page using React Navigation in my TypeScript React Native app. I have tried to follow the instructions in https://reactnavigation.org/docs/typescript, notably ...
Chip's user avatar
  • 177
5 votes
1 answer
2k views

NPM workspaces with Expo and Typescript

I'm trying to use NPM 7 workspaces within a Typescript Expo project. For now I want to keep the normal Expo structure (with the root App.tsx file), but I want to isolate some parts of the code in ...
Cohars's user avatar
  • 3,942
5 votes
1 answer
4k views

expo constants not working on web anymore (empty manifest object)

i'm using firebase Auth in my expo app (Google Auth) and in order to do that, I need to set my firebase variables in a .env file (my API_KEYS, AuthDomain ...). I'm using expo constants to get those ...
ghostgarrix's user avatar
5 votes
1 answer
2k views

TypeError: Cannot read property 'viewManagersNames' of undefined - Integrating Jest and Enzyme with React Native TypeScript Package

I'm trying to integrate Jest unit testing with Enzyme on my React-Native Typescript package, but after reading docs and tutorials, I can't seem to make it work. The problem only happens when using ...
Alexandre Zajac's user avatar
5 votes
0 answers
4k views

React Native Expo - No Splash Screen Showing (White Screen)

Im running an expo managed react native project and I can't figure this out for the life of me. When I first initialized Expo I had the typical splash screen show, but now, I can't see my splash ...
mprouve's user avatar
  • 77
5 votes
0 answers
831 views

React Native expo-camera landscape video

I'm recording some videos in different orientation (landscape and portrait) but my app is forced to be in portrait mode by config. The problem is that the result of every record is saved in portrait. ...
Axel Ros's user avatar
  • 735
4 votes
1 answer
2k views

jwt-decode "This expression is not callable." with typscript

Just started seeing this error. I know this is related to the question here: Using jwt-decode with typescript front-end project However, I already am trying the answer and it's not working... The ...
Fiddle Freak's user avatar
  • 1,969
4 votes
1 answer
3k views

Unable to resolve "tslib" from <path>

I have a TS with JS based React Native application. During moving some old JS stuff to TS I'm receiving an error: Unable to resolve "tslib" from What can it mean and how can I fix it? The file ...
Vladyslav Zavalykhatko's user avatar
4 votes
1 answer
3k views

rtk query ts error jwt does not exists on type

Why I get this error ? Property 'jwt' does not exist on type '{ data: IAuthResponse; } | { error: FetchBaseQueryError | SerializedError; }'. Property 'jwt' does not exist on type '{ data: ...
universe11's user avatar
4 votes
1 answer
3k views

Task :expo-dev-menu:compileDebugKotlin FAILED

Summary Expected: running npx expo run:android to compile the app. Fails with error: Task :expo-dev-menu:compileDebugKotlin FAILED enter image description here > Task :expo-dev-menu:...
Vladislav Cherkasheninov's user avatar
4 votes
1 answer
1k views

expo-assets useAssets: Type 'Asset' is not assignable to type 'ImageSourcePropType'

Following the small example provided by expo-asset's docs, passing an element from the asset array to an Image source prop gives the following typescript error: No overload matches this call. ...
Tommaso Morganti's user avatar
4 votes
1 answer
1k views

React Native: platform specific import

Got this weird situation. Building for react native and using a native package from Intercom. Importing it works fine when android or ios. But for the web (or node jest) it throws an error. So have to ...
Norfeldt's user avatar
  • 9,220
4 votes
1 answer
1k views

Compile TypeScript with react-native-typescript-transformer?

Since Expo SDK 31 there is TypeScript support integrated. That’s great. However, as far as I can tell, it uses babel-typescript. For my project, running on Expo SDK 33, I need to use react-native-...
Kaloyan Kosev's user avatar
4 votes
2 answers
2k views

How to debug React Native project created with Expo using TypeScript

I created an Expo boilerplate project that is using TypeScript. When I run the app with expo start, the Chrome debugger opens up at http://localhost:19001/debugger-ui/, but in the devtools I can only ...
marchello's user avatar
  • 2,106
4 votes
0 answers
493 views

Uploading Images from Expo app to local server in typescript

I'm working on an upload and fetch images app using Expo, node.js and Typescript. I created my own local server where images are uploaded using Multer and URL is stored in mongo dB using mongoose. ...
bixtico's user avatar
  • 41
4 votes
0 answers
344 views

How do you prevent expo from using devDependencies?

I have a project where I put a React Context code into a local module and included it using nom install directory The package.json itself has the following "devDependencies": { "@...
Archimedes Trajano's user avatar
4 votes
0 answers
1k views

jest test freezes with typescript

Repo with reproduction: https://github.com/nmatushevskiy/jest-with-typescript Hello everyone, i've had a strange issue. I'm using jest, typescript, react-native, expo, babel, and components library - ...
nmatushevskiy's user avatar
4 votes
0 answers
576 views

react-native jest: cannot read property 'default' of undefined

I have looked at a number of solutions for this problem online but none has worked for me (e.g this). So I am trying to run my tests in a react-native + expo + typescript project. Here is my test (...
TheSoul's user avatar
  • 5,196
3 votes
3 answers
7k views

Adding TypeScript to React-Native Expo project

I am trying to add TypeScript to a React-Native Expo project and get the following error if I rename any file abc.js to abc.tsx: I have been following the instructions at: https://facebook.github....
Ben's user avatar
  • 16.5k
3 votes
1 answer
4k views

Unable to use babel-plugin-module-resolver with expo and react-native

I am new to Expo and React Native. I am facing some problems in using absolute paths while importing the modules. I came across the well known babel-plugin-module-resolver plugin but i am unable to ...
Usman Iftakhar's user avatar

1
2 3 4 5
10