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

How do i switch elements from object, when there are no initial state in the...

a guy helped me with this codeimport React, { useEffect, useState } from "react";import _ from "lodash";// const SeleccionClientes = "";const items = [ { client: "Microsoft", idClient: 0,...

View Article


How to inherit react SectionList prop type in typescript?

I am creating a wrapper around SectionList, which should take all props that SectionList takes, plus my custom props. How can I configure typescript for that?Here's my attempt:import React from...

View Article


Platform specific import component in react native with typescript

I am using react native with typescript. I have a component with the following structurecomponent - component.ios.tsx - component.android.tsxNow I want to import the component. So, I am doing...

View Article

Type-safe navigationHandler with React-Navigation

I have an issue with Typescript and React Navigation for my React Native app.I've got the follow setup in my project, which gives me awesome help and autocompletion when using e.g....

View Article

How do I build apk from edited source?

Good Day/Afternoon !I just fixed some-how problem with expo start , but now I want build app from this source code using gradlew assembleRelease, after entering command i get this error :...

View Article


Image may be NSFW.
Clik here to view.

How focus the next field input in react native?

I need focus the next field input in react native, in android platform.But the focus() function, not exists in android react native, only in IOS.How make this ? I use react native with typescript.

View Article

Accessing react native StyleSheet member via dynamic key string in typescript

I have this stylesheet:const styles = StyleSheet.create({ primary: {}, secondary: {},})And I would like to access the keys with dynamically composed strings.<View style={styles[props.type]}/>This...

View Article

How do I find element in object typescript code

So, am trying to assign colours to my icons dynamically ... but this line of code keeps complaining,let icon = iconsList[name];When I hover of it .. This is the explanation "Element implicitly has an...

View Article


How can I attach a ref to a component that i am copying using React.cloneElement

hey all I want to pass in a ref into my component this way I can access the variables on said compenent like state. only issue is i can't seem to get it to work. It needs to be able to work for both...

View Article


Image may be NSFW.
Clik here to view.

JSX element type 'string' is not a constructor function for JSX elements....

So i have been working on a reusable icon element that I can call in any class and just pass a string <Icon name="chat" /> that contain the specific colour of the icon .. This error is the result...

View Article

Image may be NSFW.
Clik here to view.

How to define SCSS type attribute with REACT property

Basically I want to create a reusable component which can be slightly modified from the outside in react:SomewhereElse.tsx...<FooComponent width={200}>...FooComponent.tsxinterface IFooProps {...

View Article

Image may be NSFW.
Clik here to view.

White Space Showing Up on Navigation - SafeView

Previously, I was using toggling to handle navigation. Now I am switching to useNavigation hooks. From one page, I move to another page like this:<TouchableOpacity onPress={() => { if (title ==...

View Article

How to put View into ternary conditional? [closed]

first glance, I have following snippet:{ (condition) ?<View/> 1 </View> : <View><Text>2</Text></View>}=> it'worksHowever, If I replace View 2 by View 3 with...

View Article


unable to use useNavigation for one screen

Previously, I was using navigation with toggles and modals. However, now I am switching to navigation with the hook. I have an AddFriendPage that looks like: export const AddFriendPage:...

View Article

Struggling with some typing in TypeScript

I'm new to typescript and I'm trying to figure out how to type a specific generic object so that I can have any key + object in the interface. This is a ReactNative Tutorial that I am doing however...

View Article


T extends ChangeEvent ? void : (e: string | ChangeEvent)

I have a custom Input component that I am using for Formik input validation. It looks like this:export const FieldInput: React.FunctionComponent<FieldInputProps> = ({ handleChange, handleBlur,...

View Article

set state not working react hooks(string) asyncStorage [duplicate]

hey all so im using react-natives-community async storage and i can't for the life of me get the state to save and im not too sure why. the first console.log from the await variable returns the correct...

View Article


how to update an object using useEffect in Reactjs and Typescript

I am very new to Reactjs+Typescript and i am trying to figure out why i am getting the error below.React 16.9const STEP_STATUS = { COMPLETED: "Completed", INCOMPLETE: "Incomplete",};const Foo = ()...

View Article

How do I Build app without :app:bundleReleaseJsAndAssets error?

I need help , I need fix this error when building apk using gradlew assembleRelease , configuration is succesful , but when executing at 40% there throws an error : > Task...

View Article

How to create reusable component in React with hooks and interface

I am new to react and i am trying to build a reusable component from the logic below, a form with many steps.Please note:The next person using this component can add as many steps as they want.The next...

View Article
Browsing all 6212 articles
Browse latest View live