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

FlatList Typescript error missing return type on function

Im trying to use a interface on the renderItem={({ item }) from flatlist, but whenever i try im getting the same error."Missing return type on function....

View Article


React Native Expo cannot find type declarations

I am using React Native with Expo framework with Typescript and my tsconfig.json have an include declaration with the path to the file with type declarations for images//images.d.tsdeclare module...

View Article


How to use Metro's config to not look for extension when resolving a file?

I'm trying to modify my metro.config.js file so that it will not ignore an npm package's main module.This is the error message I receive at runtime:error: Error: While trying to resolve module...

View Article

Can't import module with typescript alias in storybook for react native

What I facedI'm creating a mobile app with TypeScript, React Native, and Storybook.A storybook code can import another component something like below without TS Error.Button.stories.tsximport React...

View Article

A problem was found with the configuration of task...

I am facing this issue for 2 days but nothing I have got, there is no specific answer or any article for this error also i am still confused about where to find these files in the android folder or in...

View Article


remove object from array using an id before saving it in local storage in...

I am saving few data as an object in array in my local storage using AsyncStorage, I am able to do it in following way:const [saveData, setSaveData] = useState([]);useEffect(() => {...

View Article

Image may be NSFW.
Clik here to view.

How to import a custom file in javascript using require()?

I'm getting started with react native and there's a problem I'm facing when trying to import a custom PyTorch lite model using require function. Here's the syntax from an example typescript file:const...

View Article

React Native Get Current Location

I am trying to get the user's current location when the checkbox "current location" is selected. I have a form with user inputs and when the form is submitted and current location is selected, the app...

View Article


Image may be NSFW.
Clik here to view.

How to import a custom file in typescript using require()?

I'm getting started with react native and there's a problem I'm facing when trying to import a custom PyTorch lite model using require function. Here's the syntax from an example typescript file:const...

View Article


Check if date is "today", "tomorrow" or "after tomorrow" Vanilla JS [duplicate]

I want to share with you this snippet code that can be checked if the input date is "Today", "Tomorrow" or "After tomorrow" below.

View Article

Image may be NSFW.
Clik here to view.

RN - navigation with typescript passing params

I'm trying to create a minimal working example for an app with common navigation usege with typescript. Just to use it as reference for future projects. To be honest I'm struggling a bit to understand...

View Article

Cannot use "interface" declarations from TypeScript in JS (React Native tests)

I have a ReactNative app and I am trying to write a test using Jest. My test need to use classes from a native component (react-native-nfc-manager) and a class I need is declared like this export...

View Article

Image may be NSFW.
Clik here to view.

React Native array.length gives me 0 even when data is in array

I am having trouble with something that seems ridiculously simple and I can't believe I have had to result to this.I have an array messages: Message[] = [...] that I need to iterate through. However,...

View Article


React native jest TypeError: mockResolve is not a function

I'm working in React Native ts project and using jest + react testing library to test my components.In a test, I modify a function implementation like this:test('should be rendered when position is...

View Article

React Native cannot find name of Global Object?

I use the global variable in React Native, Eg: global.gScreen = { };When i use gScreen, eslint reports can not find name 'gScreen'.I have try this:In tsconfig.json add "node" to compilerOptions.types...

View Article


Image may be NSFW.
Clik here to view.

React Native array.length gives me 0 even when data is in array

I am having trouble with something that seems ridiculously simple and I can't believe I have had to result to this.I have an array messages: Message[] = [...] that I need to iterate through. However,...

View Article

Argument of type '{ [x: string]: any; }' is not assignable to parameter of...

ErrorArgument of type '{ [x: string]: any; }' is not assignable to parameter of type 'Contact'.Type '{ [x: string]: any; }' is missing the following properties from type 'Contact': id, contactType,...

View Article


ReactNative - Invalid hook call with useSelector

The following error appear only when I add the "useSelector" row. If this row is commented, everything works fine."Invalid hook call, Hooks can only be called inside of the body of afunction component....

View Article

React Native + Typescript: how to dinamically render a Component [duplicate]

I've been struggling for 3 hours with this problem. const steps = [ { Component: ChooseGameMode, props: { initialValue: gameMode, onComplete: handleChooseGameModeComplete } }, { Component:...

View Article

Image may be NSFW.
Clik here to view.

Is there a way to add x and y axis labels to ReactNative's chart kit?

Is there a way to add x and y axis labels to a line chart from the ReactNative Chart kit? For example, in this graph generated with python you can see that the x and y axes are labeled "Year" and...

View Article
Browsing all 6287 articles
Browse latest View live