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

Is it a good practice to use switch case in useEffect Reactjs?

I am handling some functionality in some functions. Basically I am handling some states in multiple functions. Those functions need to be called when particular state updates. Now there are a lot of...

View Article


Modify Interface values while using useContext in React Native

I have a context like this,In each page I have to update certain fields in the interface from their initial values,how can I change each values in that interfaceAssignment operator shows error :- The...

View Article


Trouble navigating to a different page after calling a function

I am using openrouteservice directions to calculate a route, i am able to return a route however when i try to navigate to another page after calculating this route, i get an error. I believe the error...

View Article

Image may be NSFW.
Clik here to view.

Delete nested field in Firestore

I'm trying to delete a nested field in Firestore but I get FirebaseError: Function updateDoc() called with invalid data. deleteField() can only appear at the top level of your update dataSo what I'm...

View Article

react native ts imports aliases

I try to use aliases in ma react-native ts project but my aliases doesn't work...Here is my babel.config.js: presets: ['module:metro-react-native-babel-preset'], plugins:...

View Article


ReactNative - "expo start" works with tsx file which is not conforming...

I've just started reactive native.I created a project with "expo init" with "blank (TypeScript)" option selected.Created a component called GoalItem.tsx as below,import React from 'react'import { View,...

View Article

Change language based on user selection on expo

Just wondering if there's any way to change the language of an expo app with typescript based on user selection (so not device language).I read through the docs on expo...

View Article

event.target.value for datetime piker

How do I set a react state with a event.target.value in a datetime piker?Here is my code that is not working:const [ date, setDate ] = useState(new Date());<input type="datetime-local"...

View Article


Monkey patch react-native Text component with TypeScript

I want to monkeypatch react-native Text element render function.Typescript shows me some errors, as the exported Text class does not expose the defaultProps static member each instance has internally...

View Article


React-Native: Memory Leak with Dependency Variable

I ran into this issue by trying to resolve this warning from the eslint-plugin-react-hooks:warning React Hook useEffect has a missing dependency: 'promisedObject'. Either include it or remove the...

View Article

Create App with React Native and typescript

I'm trying to create an app with React Native and TypeScript, but it's not working. I use the following commands:npx react-native init MyApp --template react-native-template-typescriptAnd the log...

View Article

Promise resolves with 'random' string upon cancellation (Axios, React Query)

I'm having an issue I find difficult to resolve.I'm creating a React Native app using React Navigation. My app has an authentication system. When my token expires, the server sends a 401 to my app. In...

View Article

React Native with TS relative path not working

I am trying to use relative path using babel-plugin-module-resolver, but no matter what I make, it doesn't work. I've read the React Native docs about it, and the babel lib docs too, but the metro...

View Article


How to make categories list that contains products in react native

I have an e-commerce app, and I want to have categories where each category contains different products list based on the category, how I would do that ?Here is my codethis one called...

View Article

Image may be NSFW.
Clik here to view.

Set Up Custom Component Type That Using TextInput props and make it work when...

I am creating a custom component, the script is written in TypeScript using React's HooksMy component will be using some of my typescript type and mix it with TextInput type (so i can access TextInput...

View Article


Remove Warning : [react-native-gesture-handler] Seems like you're using an...

I'm creating a project to learn React Native. I'm using typescript on this project. I added react-navigation : To make react-navigation working, I had to do :yarn add @react-navigation/nativeyarn add...

View Article

Is there a better way to add optional values to an object?

Currently I'm doing the optional addition using something like this ...(!!providerId && { providerId }), ...(!!practiceId && { practiceId }),Is there some shorthand logic to replace...

View Article


Creating a Button component in Typescript

I have to create a button component for my school project that should have an edit, cancel , save ("Save" should be shown in dropdown when clicking "..."). Everything should be in typescript and i have...

View Article

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

SafeAreaView ref generates a Typescript error

I'm getting a stragne error in TypeScript SafeAreaView component. I crated other refs for WebView and it doesn't fail, only seems to fail when assigned to the SafeAreaView component.import { useRef,...

View Article
Browsing all 6287 articles
Browse latest View live


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