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

How to access expo-file-system Filesystem.documentDirectory

I am trying to do a data backup for my React Native App with expo go and expo-file-system await Filesystem.writeAsStringAsync( Filesystem.documentDirectory! +"GymTracker-Data.json",...

View Article


How to delete key from object in React Native javascript

I have an object named "colors" which have keys like{"white":"#FFFFFF","black":"#000000","red":"FF0000"}In some of the conditions i want all colors except the "white" color

View Article


Testing expo-linear-gradient in react native ,throws TypeError: Cannot read...

My Error: TypeError: Cannot read property 'includes' of undefined at requireNativeViewManager (node_modules/expo-modules-core/src/NativeViewManagerAdapter.native.tsx:28:49) at Object.<anonymous>...

View Article

React Native Navigation Argument of type 'string' is not assignable to...

I have this problem with react native, react navigation, even with this error the navigation flow is still working.Argument of type 'string' is not assignable to parameter of type '{ key: string;...

View Article

Using react hook form with custom react native picker modal fails to register...

Hello i'm fairly new to react native development for a few weeks and i'm attempting to connect react hook forms with a custom picker i implemented. The custom picker consists of a disabled text input...

View Article


Typescript complaining about Absolute imports in React Native

So Im trying to implement Absolute imports using JSON files in directories.In JSON:{"name": "components"}I have specified paths in config JSON, but still not working, I have tried with baseURL and...

View Article

How to capture physical barcode scanner's scanned input text inside a screen...

I am working on an application using React Native version 0.68.2.I would like to detect a barcode scanning event from a physical scanner hardware available in the mobile itself (it is a handheld...

View Article

How to create an alias for an enum in TypeScript?

In my project I have a set of auto generated enum types, which I include from. Their names are long and I would like to created aliases for them. Let's say I have some enums with the following...

View Article


Cannot use enum values imported from GraphQL Codegen types

Whenever I import enums from graphql-codegen generated types and use their values, the app fails to start.import { MyEnum } from 'graphql-types.ts';let x: MyEnum; // This worksx = MyEnum.MY_ENUM_VALUE;...

View Article


Format date as user types to MM/DD/YYYY in typescript

Hello i working on a react native app where a user enters their date via Textinput but as the user types i would like to format the date to MM/DD/YYYY. So far i have this function const...

View Article

React-native Unable to resolve module styled-components/native

The importimport styled, {ThemeProvider} from 'styled-components/native';package@types/styled-components-react-nativetsconfig.json// prettier-ignore{"extends": "@tsconfig/react-native/tsconfig.json",...

View Article

When to use useCallback in React?

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

Types for cardStyleInterpolator props

I am using this in my navigation stack:<NavigationStack.Screen name="UserMenu" component={UserMenu} options={{ headerShown: false, cardStyleInterpolator: forSlideFromLeft, }} />const...

View Article


Downloading PDF/image with blob

Hi I'm bothering with display data in logs by console.log(). I'm using redux toolkit with react native and I'm always getting an undefined in response.So this is where I made my query:downloadInvoice:...

View Article

Typescript compile errors after upgrading react native project

I'm trying to upgrade a react native project from 0.63.3 to 0.67.0, and I'm getting too many errors when I try to run npm run tsc. and It seems like the typescript packages are not compatible with...

View Article


Display the weight values the user has picked in Segmented picker

I am trying to display the weight the user picks using the scroller below the button but I cannot find the right combination of useState and this.value to make it appear. I have conditional filtering...

View Article

Navigating without the navigation prop - typescript typings

I'm trying to include React Navigation 6.x into a React Native project with Redux and therefore need to be able to access the navigator from outside components.I'm following this guide (Navigating...

View Article


React Native - change color based on api value

i'm making a React Native project, and basically, i wanted to change a styled component background color based on the value of the api, but no idea how i'll make this(i'm using: React Native, Expo,...

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

TS2305: has no exported member when importing from a barrel file

I am using webpack and typescript in expo applicationI have 2 TS files then export functions for example:// folder/file1.tsexport function func1() { ... };// folder/file2.tsexport function func2() {...

View Article
Browsing all 6287 articles
Browse latest View live


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