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.

How to keep marker at the bottom of the screen when zooming like google maps?

I was wondering if it is possible to change the default behavior zoom, the default seems to change the viewport in all directions, but I want to keep the bottom where it is, and only resize the other...

View Article


Image type in typescript

Hello guys what should be the type of Source and StyleThe source is going to contain the image file location. Something like thissource = require('../../../assets/user.png')and style is going to have...

View Article


Image may be NSFW.
Clik here to view.

This expression is not callable. Not all constituents of type 'string |...

I have my custom useResults hook like thisimport { useEffect, useState } from 'react';import yelp from '../api/yelp';export default () => { const [results, setResults] = useState([]); const...

View Article

Error app.default.object is not a function

I am new to react-native and I'm trying to help on a project. I started by refactoring the code to have a better file structure. I implemented the barrels and added the path aliases (module...

View Article

Jest cannot find module @env React Native

I'm currently facing some problem I'm using in my react native app https://github.com/goatandsheep/react-native-dotenv for handling .env.Error => Cannot find module '@env' from 'src/api/api.ts'I'm...

View Article


How to redefine type for React class prop

I´m using Avatar from react-native-elements and the ImageComponent prop is typed as React.ComponentClass (IntelliSense report type React.ComponentClass<{}, any>)When using a functional component...

View Article

Image may be NSFW.
Clik here to view.

React Native Paper the List.Accordion I can put the Icon

ObjectiveI am using the library react-native-paper and I am using the List components, but in the List.Accordion appears one strange image at the right position, I would like to put an icon arrow down...

View Article

How to remove a text from the StatusBar using React-Native?

I have a problem with this code:<Tab.Navigator shifting={false} barStyle={{ backgroundColor: home ? '#000' : '#fff', }} initialRouteName="Home" activeColor={home ? '#fff' : '#000'}><Tab.Screen...

View Article


React Native useRef with custom TextInput and TypeScript

I am getting the following warning on my custom input component:'TextInput' refers to a value, but is being used as a type here. Did you mean 'typeof TextInput'?When referencing it using useRef like...

View Article


How to avoid Typescript Object is possibly 'null'. TS2531

I am trying to get the scroll position using the following code: useEffect (()=>{ document.addEventListener("scroll", e => { let scrolled = document.scrollingElement.scrollTop; if (scrolled >=...

View Article

Const variable as type - Typescript

During learning Typescript I faced problem when I used constant variable with the value of action which I use to reducer (created to prevent typo - I have read somewhere it is good practice).const...

View Article

map function in React-Native

I am new to React Native and I am using Typescript for my project. I am difficulty to do mapping in React Native. Below is my code for interface:interface Teacher { name: string; sex: string; age:...

View Article

Image may be NSFW.
Clik here to view.

I need to create a Dropdown submenu in React Native

Hi guys, i need to create a dropdown submenu in react native.Right now, i'm using typescript in my proyect and react navigation and i can't find any updated and correct solution for this issue.I need...

View Article


Can't change or use properties from imported TextInput in React Native

I was trying to use a created TextField component inside Formik, I created my own TextField component called Input and imported inside the form, but I cant change any of it's props or call it's...

View Article

How to access Enum in typescript ? giving error "Element implicitly has an...

export enum r { color1 = "Red" color2 = "green" color3 = "blue"}ar = ["color1", "color2"];ar.map(e => { if (r[e as any] !== undefined) { return r[e] }})Above statement giving "Element implicitly has...

View Article


Image may be NSFW.
Clik here to view.

How to check type in react-native?

I have a problem, already solved it, but make me confuse about modules.I tried to import an Animated in my component.import { Animated, Easing } from 'react-native';and then, I tried to find Its type...

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


Navigation.navigate is not a function , navigation is underfined

i have a problem , in React-Native.Can someone help me<Button title="Save" onPress = {() => navigation.navigate('Save' , { image })}/> {image && <Image source = {{uri: image}}...

View Article

Navigation.navigate is not a function, navigation is undefined

I have a problem, in React-Native.<Button title="Save" onPress = {() => navigation.navigate('Save' , { image })}/> {image && <Image source = {{uri: image}} style= {{flex:...

View Article

React / TypeScript error when updating array using setState()

I am looking to modify a property of one of the items in the array using the updater returned from setState. The function is passed as props to the child, who then call this with their own index to...

View Article
Browsing all 6287 articles
Browse latest View live