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

Module '"./node_modules/react-native"' has no exported member 'View'

After i convert my project in typescript showing me following errorModule '"./node_modules/react-native"' has no exported member 'View'.import React from 'react';import {StyleSheet,View,Text} from...

View Article


React navigation name issue

Ive inherited some code here and I'm just confused as to how the app knows where the 'NextPage' is.I call this: this.props.navigation.navigate('NextPage');With this:import { NavigationScreenProp } from...

View Article


Poll and update state UNLESS a specific prop updates

I'm building a React Native application that is polling for wallet balances every 6 seconds. I've setup a timer which I am using to 1) call ONCE initially for balance (ie. not wait 6 seconds for the...

View Article

How to mock React Navigation's navigation prop for unit tests with TypeScript...

I'm building a React Native app with TypeScript. For my navigation I use React Navigation and for my unit testing I use Jest and Enzyme.Here is the (stripped down) code for one of my screen...

View Article

Image may be NSFW.
Clik here to view.

How to fix "TypeError: Cannot read property 'text' of null" for typescript...

I am getting this error whenever I try to set the value of my TextInput to a state of the code, here is the code for that:<TextInput style={styles.inputBox} placeholder="Word Here"...

View Article


How to pass data back to previous screen in react native navigation v5?

I just updated to react native navigation version 5. Now I am trying to send data back to previous screen on goBack() call.I push next view with const onSelectCountry = item => {...

View Article

How do you write JavaScript within HTML of TypeScript file?

I am developing a project with React Native which uses TypeScript. And coming from React.js, I noticed I am not able to put JavaScript within the HTML. Is there a way I can use the following code...

View Article

How do I configure absolute paths for imports in TypeScript based React...

In order to avoid '../../../../' style relative imports in a TypeScript based React Native app, I would like to configure the app so that I can use absolute imports instead.It is important that the...

View Article


Image may be NSFW.
Clik here to view.

Import types two different project

I have a project which includes two sub projects. Web for web(react), native for RN. I have common styles for components, then I created interfaces. Developer could write web or native style codes. The...

View Article


Css Properties and TextStyle Types

I have a textStyle which is a type of TextStyle (it comes from react-native types) or React.CSSProperties. I want to pass this type to style attribute for html span element. style attribute accepts...

View Article

How to set autocomplete for react native elements input on iOS?

I am trying to set correct autocomplete suggestions on my registration form.I am using react native elements input, I have set username, email and password field.On email field I have...

View Article

Unknown Option error from Babel in React-Native app

I ma building a react-native app with typescript in order to learn react native. Once I run the app with expo start and try to run on emulator I get this error:index.js: [BABEL] ......../index.js:...

View Article

React Native Typescript Formik cast event type

In the Formik documentation for React Native it has an example form:<Formik initialValues={{ email: '' }} onSubmit={(values) => console.log(values)}> {({ handleChange, handleBlur,...

View Article


Why does consulting a json file take so long on the real device and on the...

I execute a query to a json file through the fetch function and in the emulator the result is immediate, it takes a century on the real device (motorola one vision) to give results.What can it be? I...

View Article

Component Exception: Too many re-renders

I' ve go a problem with passing data between screens.Here is the screen where i'm taking input:import React, {useState} from 'react'import {View, TextInput, Button, StyleSheet,...

View Article


ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...):...

I am facing a flowing issue ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'LinkingManager' could not be found. Verify that a module by this name is registered in the native binary.I...

View Article

Is it already possible to use top-level await in react-native?

Is it already possible to use top-level await in react-native? I saw it's been added to TypeScript 3.8 (I was not using TS, I just tried to see if it would help but no). However in react-native file...

View Article


Image may be NSFW.
Clik here to view.

React native with typescript - how to use the useRoute from...

I'm trying to get my incident object from route.params but I don't know how to do it to make typescript recognize this prop.Here is the function that navigate to my Detail page passing incident to...

View Article

Cannot re-render flatlist using boolean toggle

I'm struggling to re-render a flatlist. I'm trying to use a boolean refreshToggle, that is fed into extraData, that is changed after the desired information is successfully fetched. The code below...

View Article

how to solve the onClick problem in typescript Reactjs

my function is like this:async function handleFavorites(event: MouseEvent) { event.preventDefault();}on my button, I'm using onclick to call this function but it's not working<button type="submit"...

View Article
Browsing all 6287 articles
Browse latest View live


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