Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Browsing all 6287 articles
Browse latest View live
↧

How to manage the risk of race conditions in useEffects when a component can...

Using TypeScript 4, React 17 (current versions at the time I'm writing these lines).Let say I have the following component.This component is behind a React Navigation conditional stack navigator. This...

View Article


share code between multiple projects with react native? [closed]

First of all.. thank you for looking into my problem.I have multiple react-native typescript projects and they are mostly similar.. so i wanted to create a shared project. Can anybody suggest a good...

View Article


React Navigation + TypeScript Error: Type 'EventStackParams' does not satisfy...

I'm adding TypeScript to my React Native/React Navigation 5 Navigator, but having an issue with Adding EventStackParams to the createStackNavigator().I've looked through the React Native 5 Docs,...

View Article

interface does not satisfy the constraint 'Record'. Index signature is...

With TypeScript 3.9, React Native, React Navigation...I got error:interface StackParamListType 'StackParamList' does not satisfy the constraint 'Record<string, object | undefined>'. Index...

View Article

How to use this.props.navigation.openDrawer () in a class component without...

I have this component:class HeaderBar extends Component<Props> { render() { return (<View style={stylesHeaderBar.header}><View style={stylesHeaderBar.menuIconContainer}><Icon...

View Article


Typescript migration throwing error on Stack.Screen options

I am converting an application from JS into TSX, but I encountered an error that I am not sure how to fix.This is a function in my Screens.tsx file, and I have similar functions that are stacking other...

View Article

Realm JS opening all Schemas in app. Bad practice?

I would like to create a utility class for Realm for my application, keeping most of the complexity with Realm in this class. To make life easier I proposed when opening a Realm instance I open all...

View Article

What is the proper way conditionally require images assets with React Native...

Using React Native 0.63 and Typescript 4.I have an app with categories. Each category has an image that is stored as an asset with the code.I tried this:myImage = require(`${myImageName}.jpg`)But...

View Article


What is type route when I use it like param?

I use route like:<Stack.Screen component={VacancyChat} name='VacancyChat' options={({ route }: any) => ({ title: route?.params?.order.title, })}/> What type of route I should use here instead...

View Article


Image may be NSFW.
Clik here to view.

Resolving ts(2339) for react-native hooks for useState

I'm using useState in my react-native app as such:const [loginDetails, setLoginDetals] = useState({});When I try to access a property of loginDetails, I get a ts(2339) error from eslint:I don't really...

View Article

How to implicitly infer specific type

I've been trying to implicitly infer the specific type of screens in the code down below, without hard coding the type in there.The expected Result:{ element: React.FC name: 'Explore' | 'Hates' |...

View Article

Image may be NSFW.
Clik here to view.

Getting 'Text strings must be rendered within a component' for custom component

I'm trying to create a custom component that labels an icon and then some text next to it, I have it set up as such:import React from 'react';import { View, Image } from 'react-native';import {...

View Article

Image may be NSFW.
Clik here to view.

All styled components return any (@types/styled-components)

I'm having a weird issue when using styled-components along with VSCode. Below is basically what I get for any components coming from styled-components, they all return any.I got it working before, but...

View Article


Image may be NSFW.
Clik here to view.

how do I use state in tsx file that just has a default function

I had create a new react native project by init a tabs (TypeScript) .this example has 2 tabs , each tab content in a tsx file that just have a singleexport default function and how can I use sates in...

View Article

Cannot render component after signin

I've a react-native app build with expo, the signin page works fine, however, when user attemp to signin and the app change the screen to the maintabbar, the app thors these errors:1 - Can't perform a...

View Article


Invalid hook call. Hooks can only be called inside of the body of a function...

I am using React Native Typescript. I want to use Hook. When I write the code in the 1st image, I get an error as in the 2nd image. When I don't type the hook in the 1st image, it's okay, but I have...

View Article

I am new to react native. Any tips as to make an application universal; i.e...

So, essentially what I like to do is make apps which involve a lot of firebase queries. I code on visual studio using what I think is TypeScript? I have seen some reactjs resembling coding on html...

View Article


How to upload audio files with express backend and react-native?

when I try to upload audio files in my react-native project, it seems no Filelist in react-native , so I can't upload file , any one could help? thx~interface IAudioInputs { readers_id: number;...

View Article

React Native: I am using date time picker from community and it is converting...

I am on GMT+3 and when I use @react-native-community/datetimepicker. It converts my date automatically to the GMT+0. You can check my code below.Do someone now why it is converting?Thank you!DATE TIME...

View Article

how to navigate to a screen before the stack navigator is created?

I am new to react and essentially I am using Expo to create an app. I chose the TypeScript setup with the tabs and navigator already implemented when I ran "expo init newApp". I just have a transition...

View Article
Browsing all 6287 articles
Browse latest View live