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

TypeScript - TypeError: fs.existsSync is not a function

I am new to typescript and React, I am trying to load all files in array, const path = require('path'); const fs = require('fs'); const directoryPath = path.join("/checking/"); if...

View Article


React Native SegmentedControl: How can I use Typescript to type case the...

How can I use Typescript to type case the onChange "event"?I've tried using (event: NativeEvent) as onChange={(event: NativeEvent) => setSegmentIndex(event.nativeEvent.selectedSegmentIndex)}, but no...

View Article


the Keyboard is not staying up (losing focus after each key) - TextInput

Here below can you see the code that I have, now this code is part of a much bigger project, but I am wondering if you guys can see anything that would make it lose focus, or if you can by any chance...

View Article

How to use classes and props at the same time javascript react native

I was using const so that I could the navigation props for my screens. Now, I need to implement the componentDidMount(), but I have to switch to a class to do that. How can I have it so I can have the...

View Article

TextInput in FlatList item gets unfocused when changing value

Im using a nested object wich is safed in my redux store to render my FlatList. In each set item I got a textInput to change the reps in my set but every time I change the value of the input it gets...

View Article


Is there an equivalent chart.js 2 dataset prop for victory?

I'd like to use multiple datasets for my react-native mobile app. In chart.js 2, there is a datasets prop that can be used to call different datasets, and display them on the same graph with the same...

View Article

Redux Thunk, Modifying state: Unhandled promise rejection: Error: [Immer]...

While working on a React Native application with a persistent Redux store (in TypeScript) I ran into the following problem:I built a Thunk that queries an API, this API sends back a set of question...

View Article

how can I multiply two elements using typescript with react native?

I am working in a project with React Native and TypeScript. I have a TextInput that convert the Peso Argentino into Real Brasileiro, the currency value is fixed, I pretend to use an API later. However,...

View Article


Is there any way to combine useContext with an arrow function?

I'd like to use the useContext and createContext with an arrow function. I want to be able to use variables inside Foo and pass them in createContext.export const Foo = () => {...}Combine above and...

View Article


TextInput in FlatList item gets unfocused when changing value of redux object

Im using a nested object wich is safed in my redux store to render my FlatList. In each set item I got a textInput to change the reps in my set but every time I change the value of the input it gets...

View Article

How to use variables from other consts in javascript?

I'm building an app that fetches the user's location and stores the latitude and longitude in variables. I use those variables to fetch the user's county, state/province, and country using a google...

View Article

Extract/Match specific words from a paragraph in JavaScript

I'm currently working on a react native (JS based) project in which I need to match and extract Hospitals' names from dynamic paragraphs coming from the backend server. I know about match(), includes()...

View Article

standard expo typescript template + SafeAreaProvider/SafeAreaView is...

I just started a new project with a standard expo typescript and wanted to use the SafeAreaProvider/SafeAreaView from react-native-safe-area-context. When I do this and enter a component to render with...

View Article


Problems creating type definition for js library

I want to use a React Native/JavaScript library(without type declarations) in a TypeScript project, but then immediately run into a TS7016: Could not find a declaration file for module...

View Article

React Native Custom TextInput with additional field in Typescript

I want to build a component that takes an Icon parameter and passes all other parameters to a styled-component Input (based on TextInput). In Javascript, it's quite straightforward:const Input =...

View Article


How to use React Native props with interface props together

I have const Bar which uses React props to pass variables in text components. I'd also like to add in an interface props which enables onPress functionalities for buttons. Is there a way to combine and...

View Article

How to use variables from exported constants in other files?

I have this exported const in one file useLocation.tsx where I get the user's location and retrieve the user's county, state/province, and country. I also have an exported const in another file...

View Article


how to resolve this error element type is invalid?

I'm getting this error:Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your...

View Article

I couldn't run the unit test in react-native Jest?

I've RN App and want to run the first test, but I got this error$ jest FAIL __tests__/App-test.tsx● Test suite failed to run SyntaxError: Unexpected token / in JSON at position 4 at JSON.parse...

View Article

You may need an appropriate loader to handle this file type, currently no...

I'm trying to configure my web storybook for react-native and typescript project.I was following a tutorial, having webpack too, and everything was fine just till the end.My storybook appears empty and...

View Article
Browsing all 6287 articles
Browse latest View live


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