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

Cannot find module 'react-native-reanimated/plugins

this error show up on Android Studiothis error building the server

View Article


React Native: Rendering of List not working

I currently stuck in a problem with rendering a list in react-native.This code renders only the first array element of the cards array, but not all array entries.Did I missed something?Cards Array...

View Article


How to wait for an fadeout function to end?

I would like to change a value when a fadeOut function is over.I have the following function: const fadeOut = (duration: number = 300) => { Animated.timing( opacity, { toValue: 0, duration,...

View Article

How to use react native Picker with mobX-react (6.3.1)

I'm new to MobX and I need to use old version of this (6.3.1).Can you explain me right way to use it?I have Picker, but when this value change - there is no update on the screen. But variable have new...

View Article

react native textinput ref typescript

Whats the right type to use in my text input ref ?It shows me error on line " <TextInput ref <-">const RefComponent = () => { const inputRef = useRef<HTMLInputElement | null>(null);...

View Article


React native - Using useRef with Input element from react-native-elements...

I'm building an app on react native and I'm trying to set a ref on an input element from the "react-native-elements" library.I'm getting the following error:Type 'HTMLInputElement | null' is not...

View Article

How to type promises on react context with typescript

I'm learning to implement typescript in react and I'm struggling trying to implement a couple of async functions on context.The error I'm getting is the following:Argument of type '{ userData: null;...

View Article

Failing to connect my ChatRoomScreen to the navigation

Code BelowSyntaxError: /Users/suspect/Desktop/Dev/chatApp/Messenger/navigation/index.tsx: Did not expect a type annotation here. (31:50)29 | function RootNavigator() {30 | return (31 |...

View Article


Image may be NSFW.
Clik here to view.

How to send params with navigation correctly?

I'm using navigation.navigate to move between screens but I face the following problem.I call the method to navigate:const FileCard = ({ fileDetails }: Props) => { const navigation =...

View Article


Nested styled-components ThemeProviders and TypeScript

Recently I started rewriting our app to TypeScript.To make it as customisable as possible, each of our screens has its own ThemeProvider in separate file.Normally, when you use styled-components you...

View Article

How do you enable button if one of the input field is already prepopulated?

To clarify this question. I have two inputs fields, sometimes one of the input field is already pre-populated based on if its user or guest. If guest both are empty, enter text on both input the button...

View Article

Why I get no error when I use Record string with a number value?

I use Record<string, MyUser> and the key of the object is a number. Why I get no error because I set Record<string>?interface MyUser { name: string; id: number; email?: string;}const user =...

View Article

React-native-vision-camera can't access to normal camera in back

i am trying to use 'normal' camera on my iphone 11 pro.I use react-native-vision-camera.When i run this code: const devices = useCameraDevices(); const deviceBack = devices.back;...

View Article


TS Why I dont set an array at Promise in fetch?

I learn TS, and I have seen this code. There is a code like this:type FetchPokemonResult<T> = T extends undefined ? Promise<PokemonResults> : void;It retuns a array of json data. So Why is...

View Article

TS how can I this function write to a arrow function?

How can I write this generic function with a arrow function ?function simpleState<T>(initial: T): [() => T, (v: T) => void] { let value: T = initial; return [ () => value, (v: T) => {...

View Article


React, when to use useCallback?

I have gone through a couple of articles on useCallback and useMemo on when to use and when not to use but I have mostly seen very contrived code. I was looking at a code at my company where I have...

View Article

FlatList loads data multiple times

I have the next simple page:type Props = { getPostsUseCase: GetPostsUseCase}const renderItem = ({item}: ListRenderItemInfo<Post>) => (<NewsPost title={item.msg} />)const HomeScreen =...

View Article


Image may be NSFW.
Clik here to view.

is there a way to remove title on each screens in expo?

i am a beginner in react-native, i follow tutorials on youtube to make projects. i am trying to make an expo ui-app, but each screens has a title on the top like this:There is the word Explore above...

View Article

Image may be NSFW.
Clik here to view.

Extending react-native-paper Button and Text components in TypeScript

I was trying to make a reusable component using react-native-paperthe problem comes when I try to use extends a type from the packageimport React from 'react';import {Button, Text} from...

View Article

Babel error while running Jest/Enzyme tests on React Native

After a huge package upgrade, when running Jest tests on our application, we have this error :TypeError: [BABEL] /home/grubshka/devel/project/src/engine/models/Hive.ts: Cannot add property 1, object is...

View Article
Browsing all 6287 articles
Browse latest View live


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