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

React Native calling actions in wrong order

I'm building a login form for my react native app. So there is a username field, a password field and a login button.I have a formReducer:const formReducer = (state, action) => { if (action.type ===...

View Article


JSON Parse error: Unexpected EOF in React Native Expo

I'm getting JSON Parse error: Unexpected EOF in Expo app. I'm not sure why this issue occurred. export const serviceCaller = <TResp>(url: string, request: HttpRequest): Promise<TResp> =>...

View Article


push in typescript of react native

I am studying typescript in react native.If I typed the following code as vanilla javascript, the app works well. But typed as a typescript, I received a message...

View Article

React Native 0.61.0+ : How to add constructor in App.js file

How to add constructor(props){} or change App.js in react native 0.61.4 + My app app.js is:import React from 'react'; import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, } from...

View Article

Use undefined instead of null in RealmJS

I am wondering if there is a way to force RealmJS return undefined instead of null on optional fields?I am asking this, because typescript's optional types is actually T | undefined, not T | null. I...

View Article


React Native unable to resolve module from file

I'm trying to store all the CSS style values into one single ts file: styles/base.ts, and export those values in styles/index.ts file. But when I try to use import the value from index.ts in my App.tsx...

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...

View Article

Must use destructuring props assignment issue

I was making an app in react-native and when I try to put on text one of the values of props, I get an error message like this: Must use destructuring props assignmentThe code is this: <Text...

View Article


How to hide a hyperlink available in antd table column?

I am using Antd Editable Rows table in typescript(Ref:https://beta.ant.design/components/table/#components-table-demo-edit-row) I have included checkbox column as well for the table. Now my requirement...

View Article


React-Native Icon at createBottomTabNavigator does not appear

I am fairly new to React-Native and I am trying to implement a bottom navigation bar. I have succeeded to do this, however, I can not seem to get the Icons working.Code that I am usingimport React from...

View Article

Typescript How to define a property type as type of type?

So I'm struggling a little to work this out or find out if it's even possible,So I'm trying to create a set of Types that are to be used in a React Native App, but this question relates to...

View Article

React Native Performance: Javascript vs Typescript

Is Javascript or Typescript different in React Native App performance?Which Javascript or Typescript is recommended for developing React Native application?I hope my question wasn't too imaginative.

View Article

Jest test failing for DrawerNavigator in a Typescript React native project

I'm new at React Native and Typescript. I have been implementing a small project with Stack Navigation and Drawer Navigation. The project has been working well but now I have to make some unit tests. I...

View Article


Typescript error trying to convert react-native flow project to typescript

Relatively new with react-native...Trying conversion of a react-native flow project to react-native typescript project. Managed to work out other compile errors, but was getting the...

View Article

What is proper replacement for React.ChildrenArray in typescript?

Why does the following react-native code give typescript error?type ContainerProps = BaseProps & { children: React.ChildrenArray<React.ReactElement<any>>; withGutter?: boolean; }; any...

View Article


Using TouchableOpacity with primary transparent gives typescript error

Below is the Code what i am trying to execute using typescript and react-native and it gives me typescript error in VSCODE IDEimport { TouchableOpacity } from "react-native"; <TouchableOpacity...

View Article

No overload matches this call in React Native

I want to separate the styles for elements to make them easier to read. I wrote next codelet styles={ search:{ container:{ position:"absolute", top:0, }, } } And then use as <View...

View Article


How do I create typescript type definitions for react-native native ui...

Let us say that I have a react native native UI component like the one in this example. How do I create a typescript type definition for it, like the ones that can be imported, for example with 'npm i...

View Article

Error in jest test: TypeError: Cannot read property 'container' of undefined

I'm trying to test a typescript react-native class using jest but the test is not passing.This is the class:import * as React from "react"; import { Image, KeyboardAvoidingView, StyleSheet, View } from...

View Article

Unexpected behaviour of rootDir and outDir

I am trying to use TypeScript with React Native.This is my tsconfig.json:{ "compilerOptions": { "target": "es2015", "module": "es2015", "jsx": "react", "outDir": "build", "rootDir": "src",...

View Article
Browsing all 6208 articles
Browse latest View live


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