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

What type should be assigned to the first argument of navigate?

I'm building an app with React Native, and am converting it to TypeScript.I have a component GigsByWeek, where a user can tap on a button and navigate to the GigDetails screen.In the process of...

View Article


Type '{ rippleColor: any; }' is not assignable to type 'ColorValue | null |...

I am trying to learn reactnative(expo) with typescript and I have an issue where typescript shows me the following error Type '{ rippleColor: any; }' is not assignable to type 'ColorValue | null |...

View Article


Type 'Element | undefined' is not assignable to type 'ReactElement

I have a component that looks like this. This version works perfectly:export default function StatusMessage(isAdded: boolean, errorMessage: string) { if (isAdded) { return <ResultAlert...

View Article

Getting error 'Property X does not exist on type Y' (ts2339) for specific...

I'm building a gig listing app with react native and firebase.Each gig document from the firestore has a timestamp with the following shape:dateAndTime: { nanoseconds: XXXXXXXXX seconds: XXXXXXXX}When...

View Article

React Native: 'Component' cannot be used as a JSX component. Type '{}' is not...

I just started a new project but i'm getting the following error with various packages, for example React Native Reanimated and React Navigation Stack.This is my package.json.{"name":...

View Article


Issue in Instagram integration in React App

My React app requires Instagram integration, I've tried instagram-login-react, react-instagram-login libraries but its giving me an error of react version error in cmd, please let me know other way or...

View Article

useSWR with optimisticData - Typescript error

I am using the new optimisticData feature of useSWR as follows:const { data, error, isLoading, mutate } = useSWR<IUser | undefined>(`/api/user`, () => apiClient.user.userGet())and further down...

View Article

Add strong typing for react navigation props

I'm using typescript in my react-native project(expo).The project uses react-navigation, so on my screens I can set navigationOptions and I have access to the prop navigation.Now I'm trying to strongly...

View Article


react-native-swiper not working after appending new slide items

In my TypeScript React Native mobile app, I'm using the react-native-swiper package and using all the latest packages/dependencies except @types/react-native (^0.70.6) and react-native (0.70.6). After...

View Article


Setting a state using spread operator updates the state vs setting the same...

I have an initial object called as initUser, it consists of initial fields of the user as followsconst initUser: UserProfile = { firstName: '', lastName: '', phone: '', email: '', // and so on};The...

View Article

Image may be NSFW.
Clik here to view.

React Native app showing weird colors in UI when testing on real device

When I test on XCode simulator, it works fine, the colours are supposed to be white. Literally zero black in the UI but when I test on an actual device (IPhone X), it looks messed up. Images below are...

View Article

Image may be NSFW.
Clik here to view.

yield call returning [TypeError: undefined is not an object (evaluating...

There is an endpoint where I can create new a Post, sending data via FormData().There is a rule on my API, which allows the user creates only ONE post per day.I got no problems on the first time I...

View Article

React Native Typescript, pass variable to another screen

I cant seem to figure how to pass variable with typescript in react native, I have tried the params but its saying undefined is not an object (evaluating 'navigation.props.value').below are the...

View Article


Image may be NSFW.
Clik here to view.

react-native: how to validate flatlist of input?

I have a list of products and everyone has 2 inputs.I want to validate that user filled all inputs with the correct values.the screen Code:const renderClients = ({ item }: any) =>...

View Article

I want to make abstraction out of Stack.Screen component in react navigation...

I have this list of screens in an arrayconst screens: [NEED_TO_PROVIDE_CORRECT TYPE] = [ { name: 'Home', component: HomeScreen, // so that i can get intellisense and autocompletion here for...

View Article


React native swipe to delete

Im looking for a lib to use swipe to delete, but i want a different swipe. I want with only one swipe the item will be deleted. I saw a lot of swipe, but every swipe lib open a little menu with...

View Article

Image may be NSFW.
Clik here to view.

"Attempted to assign readonly property" error during state update in react...

What is causing this error. I am trying to update the username field in the parent state with a reusable function. and getting the following error. It seems as though I am able to update the username...

View Article


Error: Couldn't find a navigation object. Is your component inside...

Working thru a React Native tutorial and got to a part on Routing between various components. It looks like it doesnt like the "Menu" component and its asking, as the title says,Is your component...

View Article

React-Native Navigation global typing for nested stacks

I am trying to type the navigation global with every possibility. I want to add custom parameters for multiple nested stack screens etc. The type should recognize automatically on which screen I send...

View Article

React Native tsconfig Base URL is not working

Why base url and paths work on normal React but not on React Native??This is my tsconfig file:{"compilerOptions": {"esModuleInterop": true,"allowSyntheticDefaultImports": true,"strict":...

View Article
Browsing all 6290 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>