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

React Native - useState - Text Input field is not clearing the first...

My problem is that when I enter on the airline textInput for example "TEST" and when I enter the delete keyboard button, the last character stays in the state ex: "T", but in view it shows like its...

View Article


How to combine Stack and Drawer navigations in React Native...

I want to combine Stack and Drawer navigations. I have some screens and want to show few of that screens label in drawer tab.<RootNavigatorStack.Navigator><RootNavigatorStack.Screen...

View Article


What is the difference between `x instanceof Function` and `typeof x ===...

I want to create this hook in React (ts)import { useState, useDeferredValue, useEffect } from "react";type InitialValue<T> = T | (() => T);function getStoredValue<T>(key: string,...

View Article

Node core function for reading streams not recognized in React Native app...

With some trivial modifications (including a conversion to TypeScript), I copied and pasted the JS code from this Amazon S3 Node.js example into a React Native app that I'm developing with Expo and USB...

View Article

TypeScript Error: Element implicitly has an 'any' type because expression of...

My code is just warning fine, but I'm facing an Error type from Ts while accessing an element in the object using string. useEffect(() => { const categoriesResult: CategoryResult[] = Object.values(...

View Article


Type Script - React Native : What is the best practice way to write ternary...

What is the best practice way to write ternary inside ternary like in my example code?I want to make the code more readable and correct and I want to know the correct way to write...

View Article

Set default value of boolean to false instead of undefined

I have a typeexport type ItemResponse = {....addedManually: boolean;....}At some point I parse a JSON response into this type like this: const response = await fetch( `https://api.com` ); const json:...

View Article

Is there any working solution for getting average color of an url image in...

I just want to get average color of an image and paint my background with that color. But because of I'm using expo in react native I can not find any solution for this.What should I do to tackle this?

View Article


React Native - Dropdown Value change doesn't reset the state of the...

Let's say I have a RNPickerSelect component on which I switch between subcomponents.The values of the subcomponents are 1. Flight and 2. CarThe problem is: If switch from flight to car, the state of...

View Article


Having difficulties in assinging Type for useContext in TypeScript

I am using useContext for authentication purposes and my code is of belowtype userSignup = {name: string;email: string;password: string;signup() => void;}export const AuthContext =...

View Article

Image may be NSFW.
Clik here to view.

Nativebase React Native why can't i pass a number on an input

I'm using react native nativebase and i want to pass a number to my input value but im getting an error that says i cannot pass a number to a string.<Input keyboardType="numeric"...

View Article

Unable to use typescript with expo - "It looks like you're trying to use...

I am receiving an error while trying to use Typescript with my existing expo project.While following the docs, I created a tsconfig.json file in the project root.When running expo start, I am prompted...

View Article

How to implement custom component that accepts a nested component?

I would like to implement a custom component that accepts a nested component. Something that can be used like this.<MyCustomComponent><AnyNestedComponent/></MyCustomComponent>I...

View Article


React typescript addin

I have been working on a classification addin which is connected with an api. The addin basically is used for classification. I am debugging the issue where the addin stops working after I select...

View Article

typescript Cannot add headers to a fetch api using react-native

I am using Fetch API from react-native and I am using typescript. My code looks like this:let responseLogin = await fetch('http://url_example', { method: 'POST', headers:...

View Article


i18Next React Native enum translation issue

Passing the t on the enum value is not working it givings an error. enum catSize { SMALL = 'Small', //works MEDIUM = 'Medium', //works LARGE = 'Large', //works}enum catSize { SMALL = t('sizes.small'),...

View Article

Image may be NSFW.
Clik here to view.

React Native Overlay on a ScrollView

Here's my code atm.:'''return(< SafeAreaView style = {style.main}><ScrollView style= {{backgroundColor: ""}}><View style = {style.container}><Food style = {style.food} image =...

View Article


How to get a class component type and add props to it's type?

I'm using react-native-video together with @mux/mux-data-react-native-video.Mux is used to wrap react-native-video's Video component to add data analytics features to it, so it's basically a wrapper...

View Article

React Native TypeScript Object is of type 'unknown'

Hello i converted Java script code into type Type Script the every this is working fine but Following issue is i am facing while Development pls explain the exact issue and help me out in this thanks...

View Article

Type Script Property 'login' does not exist on type 'unknown'

Hello i converted Java script code into type Type Script the every this is working fine but Following issue is i am facing while Development pls explain the exact issue and help me out in this thanks...

View Article
Browsing all 6287 articles
Browse latest View live