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

undo re-rendering when exiting screen

In my code, I take an email as an input and run a graphql query. Using the graphql query results, I use my showUsersfunction to render some components. When I hit canceland go to the previous screen...

View Article


Render and return inside a loop

In my code, I call a function showUsers. This function displays all the users in a styled box. For now, the numberOfUsers passed into it is 1, as confirmed by console.logs as well. So the loop should...

View Article


Button onPress does not work on second attempt

I have a form where I enter an email address, run a graphql query accordingly, display some results and then run a mutation. Currently, this works successfully on the first attempt. However, when I try...

View Article

Render via map instead of for loop

I am currently using this function to render some elements & display results after a graphql query: const showUsers = React.useCallback( (data: UsersLazyQueryHookResult, numberOfUsers: Number)...

View Article

Formik form with two types for FormikProps

Is it possible to have Formik form with two values for FormikProps?I have a form wrapper which can display different forms. FormWrapper:type FormData = SignUpData | SignInData;interface...

View Article


Access Values Globally with useFormikContext()

I am trying to access Formik valuesglobally so that I can add values.emailto the dependency array of my handleSubmitForm. I read about useFormikContext() and am trying to use it but I am unable to.If I...

View Article

React Native SectionList typescript error when sections contain different types

I have two sections that each define separate renderItem keys. Each section also has a different type, which SectionList doesn't seem to handle well. Is there something I am missing in defining the...

View Article

Unable to mock appcenter module in React Native

Trying to use the AppCenter package within a React Native application and set the user id for crash reporting, however when my tests run I am getting the following error console.warn...

View Article


How to resolve React Native Firebase Error (messaging().getToken()), related...

I am in the process of migrating react-native-device-info from v2 to v3 and I have a breaking change. Prior to updating the package, everything was working fine. The error appears on all emulators and...

View Article


function gets called but no rendering is done

Is there any way to check if items are actually being rendered or not? In my code, I run a grapqhl query and then re-render some items accordingly. In my code, if there are users present, the...

View Article

clear graphql data before exiting page

I am currently taking a phone number as an input and running a graphql query in my code, which works fine. However, once I click on Cancel, go back to a previous screen and then come back on this...

View Article

Import Error while importing provider from provider file

Here I am getting error like import error: 'LanguageProvider' is not exported from 'contexts/language/language.provider'.language.provider.tsximport React from 'react';const LanguageContext =...

View Article

Typescript does not throw an error when wrong type of prop is passed

I'm just trying out typescript to see what's all the fuss is about, but I'm having some problems with type checking.I'm intentionally passing wrong props to functional component to see if an error is...

View Article


Cannot upload react-native-camera TakePictureResponse to Firebase Storage

I am trying to use react-native-camera to take a photo then upload that photo to Firebase storage. I am able to retrieve the file as a blob using RNFetchBlob, however when trying to .put() into...

View Article

How to animate expanding / collapsing a text preview in react native with...

I'm creating a text component that I want to be 2 lines by default, and if the user taps on it, it will expand to the full length, and if the user taps on it again, it will collapse back to 2 lines.So...

View Article


React native dynamically set button height

I am using React Native Elements to add a button to my layout here is the code below:<Button title="Login" buttonStyle={{ backgroundColor: Colour.green }} containerStyle={{ paddingLeft: '20%',...

View Article

Describe generic component render in React + Typescript

Explaining my difficult, I already tried to find a solution, but or I don't know exactly the term to search, or don't have any answer.What I would like to do is create a ButtonBase element like React...

View Article


Promise not returning complete info from function

I have a function that completes two await tasks, one that grabs info from a database in the cloud, another that grabs the users location. The function should return a promise that contains the results...

View Article

Rendering random array element from state (React Native)

I'm trying to render a random array item from state so that (e.g - [0] might change to [2] on reload.]Here is what I tried so far, any tips or ideas please?here is my state: state = { randomItem:...

View Article

Image may be NSFW.
Clik here to view.

react-navigation 5.x: TS2345: Argument of type ' ... ' is not assignable to...

I have migrated from react-navigation 4.x to 5.x. Since I am using typescript, I am trying to add the types. I should mention that the functionality works perfectly fine. However, I am getting this...

View Article
Browsing all 6212 articles
Browse latest View live


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