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

Android App Session Expiry Error Popup shows up twice

Whenever the error type is ErrorType.SessionExpired, there are two errors displayed on Android in my app.I was able to fix it in iOS as you can see in my APIState/index.tsx file using isPopupVisible...

View Article


How to access state from a component in React - TypeScript?

How can I access my state from the component GamePieceSquares since GamePieceSquares is declared before the state is created?Here is the code:const GamePieceSquares = ({text, id} : {text:any, id:any})...

View Article


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: » - Use arrow-keys....

View Article

How to handle mutation GraphQL error instead of Apollo onError()

Server side, I am throwing a 403 Forbidden, to manage access to an API call.To catch the GraphQL error for a mutation, I've tried the following: (method #1 is working when catching errors for...

View Article

React Native API usage

I want to display some data from our Solarpanels within an RN App. I have no experience with fetching the data from an json api like this, and the tutorials I found online is not working in this case...

View Article


Cannot read property 'ApolloProvider' of undefined

I am trying to compile my React Native application version 0.64.0. Everything was ok after migration from javascript to typescript, but suddently I got this problem:Screenshot to compileI tryied delete...

View Article

Is it possible to have a spread operator while using a react props interface...

I have this AppText component where I want to use a Props interface while having the ability to accept other props fields that I can consume with a spread operator. Here is my attempt...

View Article

Pass a Children component as an argument to a function that returns another...

I wanted to encapsulate a modal in a function that returns a new component, passing the children that will be inside this component as an argument, I tried this way below, but it's not working, the...

View Article


how to keep the style if disable objects in react native?

I am trying to structure my problem: What am I working on: I am trying to do a an opening hours view in react-native (typescript) where you can turn the weekdays on and off. And for the days where it...

View Article


Image may be NSFW.
Clik here to view.

How can I change the style of DatePicker?

I'm trying to change my datepicker styles, but I don't know the properties.I'm using the following librarie: https://github.com/mmazzarolo/react-native-modal-datetime-pickerI’ve managed to change the...

View Article

How to clean up nested callbacks using context react native

I have error handling in BasicInfo screen which is determined by child components which set the state with a useCallback function. Depending on the number of child components I have im having to do a...

View Article

How to compose ParamList for nested navigators in v5?

Say I have two navigators like this:export type RootStackParamList = { Bootstrap: undefined; Login: undefined; MainApp: undefined;};export type MainTabsParamList = { Explore: undefined; Profile:...

View Article

Image may be NSFW.
Clik here to view.

Dropzone material UI reset values

I am using material-ui-dropzone package - link. There is a requirement, I want to implement a reset button for my page, and when I click reset button it should reset all the state.But the problem is I...

View Article


react native typescript 'string' is not assignable to parameter of type...

[I keep getting the error that says 'string' is not assignable to parameter of type 'never' in react native typescript and I don't know why. Can someone help me fix this bug.Thank you in advance.]1code...

View Article

Annotating useNavigation type when it is used in a generic component

TLDR:Is it possible to annotate the useNavigation hook in a generic component?If I create a <BackButton /> component that uses the useNavigation() hook is there a way to have it correctly type...

View Article


How to fix error invalid hook call react native

How can I fix this error in react native:Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:You might have...

View Article

How can I create an input mask for MM/YY

I want to create a React Native input component for a credit card expiration date.I believe I should input mask should be in the format for MM/YY. I'm not sure about autofill with...

View Article


Typescript & react-navigation: Type Information on NavigationContainer ref?

I am using react-navigation & I have encountered a use case where I need to navigate from outside a component (navigation after receiving push notification).The issue is, when using the...

View Article

Testing React Native app: How to fix: navigation.setOptions is not a function?

Here is the test:describe('<HomeScreen />', () => { it('Renders correctly', () => {// const setOptions = jest.fn(); // 1// const setOptions = (navigation: any, route: any) => { } // 2...

View Article

How to fix TypeError: navigation.setOptions is not a function

I'm trying to implement react native test library with jest to my app.For now I have a problem with the navigation on my component.When I'm running the test, I've got an error :TypeError:...

View Article
Browsing all 6287 articles
Browse latest View live


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