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

Image may be NSFW.
Clik here to view.

Unable to resolve an image which is shared between web (react) and mobile...

I have a custom npm package created in directory web_with_weback (web react project). The package is built using webpack and contains one .png image. The package is loaded by using npm link inside...

View Article


Unsure what type my prop is in react native typescript

I am trying to implement typescript into my project and I am having issues giving prop types to my swipe prop. They are both the correct type but when giving this type I get an error on line...

View Article


ApolloClient Typescript Higher Order Component issue (not assignable to type)

I'm trying to create a HOC in a React Native app, but I'm having issues getting the definitions to work. interface IWithApolloClientComponentProps { apolloClient: ApolloClient<any>;}export...

View Article

ReferenceError: Can't find variable: TextEncoder

I'm using VSCode/Typescript React 3.4.3 for a React Native project and I'm having troubles at runtime with TextEncoderThe ts code:...var encoder = new TextEncoder();var b: Uint8Array =...

View Article

Problem with passing data between screens

I've got 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


Porblem with passing data between screen (Too many re-renders)

I've got 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

Default Values with Interface in Arrow Function (TypeScript, React)

This question is specific to arrow functions. Is it possible to include the default values alongside an interface in the function parameters, and without resorting to Object.assign()?interface Props {...

View Article

Trouble re-rendering flatlist in functional component using extraData

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


React Navigation V5 + Typescript Error: Property 'fullName' does not exist on...

My Goal:I'm trying to add Typescript typings, but having an issue with route.params.fullName. When I console.log(route.params), the object { fullName: 'John Smith' } is logged. Why is Typescript having...

View Article


Props in custom components React native + Typescript

I've got a problem with access to onChangeText in my custom component.Here is the code of my component:import React from 'react';import {TextInput, StyleSheet} from 'react-native';type Props={...

View Article

useRef.current is undefined in a React Native functional component

I'm trying to focus a text input field once the user clicks a button. The code looks as follows:const refName = React.useRef();const changeFocus = () => { refName.current.focus();}with the text...

View Article

React Native (or React) listen to the style changes for the dark mode in...

Goal: Implement dark mode in react native application.A little introduction to the system:File structure:Profile.tsProfileCss.tsconstants.tsIn my application in order to separate styles from...

View Article

How do i rerender my screen after deletion from list?

Hello I've been looking through several threads on stackoverflow but I haven't been able to solve my problem. I have an app where you can save movies to a watchlist. On this specific screen I want to...

View Article


Reference Type Within itself, TypeScript

I'm trying to pass types (screen param types) to a field based on the value (screenName) entered.This is the navigation prop.export interface IEditProfileStackNavigatorProps<RouteName extends keyof...

View Article

How to rewrite this function to a interface?

My goal is to write everything in interface, TypeScript. It's for React Native.This is the function I am unable to put into an interface. The current solution is to put it outside the interface but the...

View Article


How to do AuthContext, createDataContext using Typescript for React Native...

AuthContext.tsximport createDataContext from './createDataContext';import serverApi from '../api/server';const authReducer = ({state, action}: any) => { switch(action.type){ default: return state;...

View Article

Is there a way to change the text of a element so that the text is different

I have a program where the text will change what is displayed depending on the state, the state can be 'loading', 'updating' etc. I was wondering if there was a way to do so without needing to refresh...

View Article


Rome setup for react-native project (in TypeScript)

I've been following Rome for a while, and although there is some mention of it being used for react-native (here for example) I couldn't get it set up or find any tutorials for it.Did anyone...

View Article

Unable to resolve module with graphql

I just cant put my finger on why I can't get access to this import from the .tsx file.I understand that it is because the import is a .js file but I'm unsure as to how to fix it.import { getUser } from...

View Article

Amplify React-Native Auth sign in not staying signed in?

Using amplify and React-Native with Expo, my team built a backend and api layer before I was brought on, so I had to import them into amplify. Not sure if that's important, but due to how much amplify...

View Article
Browsing all 6287 articles
Browse latest View live


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