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 ArticleImage 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 ArticleThis 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 ArticleError 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 ArticleJest 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 ArticleHow 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 ArticleReact 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 ArticleHow 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 ArticleReact 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 ArticleHow 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 ArticleConst 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 Articlemap 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 ArticleI 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 ArticleCan'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 ArticleHow 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 ArticleHow 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 ArticleHow 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 ArticleNavigation.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 ArticleNavigation.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 ArticleReact / 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