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

How can i handle the file choose event?

I get a compile error when I try to handle the file choose event for the input const onChangeHandler = (e: React.ChangeEvent<HTMLInputElement>) => { const newValue = e.currentTarget.files;...

View Article


React-Native metro bundler can't serve any file

The metro bundler can resolve the dependencies graph(the app starts in emulator) but can't resolve any assets so all images in the app are missing.This problem happens only after I upgraded from...

View Article


moment.fromNow() timezone issue

I am getting post of news from server with date that doesnt includes timezone, i know that posts is from EST time zone, example : March 30, 2020 at 10:53 AM (-5 GMT); When post was just updated like...

View Article

Why i have an error, when sending requests?

I have an error, when sending requests to api. It is https.Error: [TypeError: Network request failed]fetch(ServerLink + url +'?'+ endPoint, { method: 'get', headers: this.getHeaders(), })...

View Article

Typescript optional chaining error: Expression expected.ts(1109)

I am trying to do optional chaining in Typescript + React Native.Let's say I have the following interfaces:interface Bar { y: number}interface Foo { x?: Bar}and I try to run the following: const test:...

View Article


Jest throws error due to ReactNavigation particularly Drawer(i think)...

I keep gettingTypeError: Cannot read property 'create' of undefined and i believe it is because of react-Navigation Drawerconst App = () => { return <AppContainer />;};import...

View Article

Add style to the imported component is React

I have one independent component 'notification' with its own CSS style. I want to show the notification component in my header component but with different styling. I imported the component in the...

View Article

cannot test renderer.create in react-native, react-navigation, jest,...

I am trying to just test that my app renders correctly using jest and no matter what i do i get TypeError: Cannot read property 'create' of undefinedat Object.create...

View Article


How to map array into checkbox for React Native [TypeScript]?

I am new to React Native. I am currently using TypeScript for my React Native project. Right now, I am having a difficulty on how to map array into checkbox. Below is my json file:{ "stud_name":...

View Article


Typescript babel-plugin-module-resolver

Hello is there an equivalent of babel-plugin-module-resolver for typescript.I am trying to resolve "react-native" to "react-native-web". Example below. import { View } from "react-native"// should...

View Article

Display a string variable on SVG in React-Native

I am trying to display the user's initials (so basically text) on (or inside) an avatar (SVG). I found many topics on this but none of the syntax that I tried worked for me. I am also using TypeScript...

View Article

Argument of type 'AnyAction' is not assignable to parameter of type 'never'....

I'm working on an application, where suddenly I came across 'Argument of type 'AnyAction' is not assignable to parameter of type 'never'.Not sure which code is creating this bug, it's a huge...

View Article

React native TextProperties does not recognize style properties

In order to follow an another answer about fontWeight management with custom font, I end up with the following custom Text component:import React from "react";import { Text as BaseText, StyleSheet,...

View Article


TypeScript types for React Native's measure callback within a onLayout event?

How can I add TypeScript types to a measure callback within the onLayout event? <View ref={containerViewRef} onLayout={() => { if (containerViewRef.current) { containerViewRef?.current?.measure(...

View Article

What is the type of child

What is the type of a child?renderChildren(): void { const {children} = this.props; const childrenArray = React.Children.map(children, (child) => { return this.renderChild(child); }) ...}renderChild...

View Article


JSX element type 'View' is not a constructor function for JSX elements error...

I'm new to Typescript and am trying to implement it in my React Native Expo, but I'm getting the following error:[ts] JSX element type 'View' is not a constructor function for JSX elements. Property...

View Article

Facing some weird issue on react-native app with typescript

I'm getting the below issue suddenly after reinstalling my packages, the app is working fine but it's giving me the following typescript error, I found that my redux version changed from 4.0.4 to 4.0.5...

View Article


How to fetch data from a fake server in react native?

I have made a fake server in my laptop to fetch data. this is the data in it:[ {"id": 1,"firstName": "Bill","lastName": "Gates","email": "bill@microsoft.com","phone": "1234567898","role":...

View Article

How to get the node_modules package types in Typescript

I'm working with NativeBase (the package name doesn't matter) with Typescript. I'm creating a simple Input component that wraps the NativeBase TextInput. I added a few own properties and spread all...

View Article

Best way to upgrade React Native 0.61 + TypeScript to latest version

I've seen a log of tutorials and articles about upgrading React Native project and a lot of articles about migrating existing JS project to TypeScript. However, I have yet to see one for React Native +...

View Article
Browsing all 6211 articles
Browse latest View live


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