Is there a way to create variables for react hooks at runtime
Is there a way to create variables for react hooks at runtime, so that the value of variables can be extracted and passed to an API at runtime as against having specific variable names created at...
View ArticleTypeError: _this7._config.server.rewriteRequestUrl is not a function React...
I have followed all the instruction given at this upgrade helper for upgrading RNv0.62 to v0.64.1 and my app is getting installed successfully in the device but my metro bundler is failing with some...
View ArticleHow to validate interdependent strings using yup in react native
I have two strings of date start_date and end_date. Below have empty string as there initial value:export interface FilterSchema { start_date?: any; end_date?: any;}const initialValues: FilterSchema =...
View ArticlenavigationOptions do not exist on type - react-navigation v6 with Typescript
I'm currently trying to integrate Typescript with React Native and I'm having issues using the react-navigation v6.I've read plenty of resources around this but it's all related to older version of...
View ArticleWaiting for a loop containing asynchronous calls to finish
I have been trying to find a solution to a problem regarding an asynchronous method, I have tried various types of loops, using async/await, as well as Promisies, but none I try seem to work for me.So...
View ArticleAnimated error after coming back to React Native app
I'm trying to animate a Button's borderColor in React Native and I got it workin. In my app's context this button opens an intent to leave the app, but when it comes back to the app I get an...
View ArticleHow to map an API with Typescript in ReactJS?
I'm new to Typescript and I have to get a list of books from an API. My profesor gave me the code in javascript to do this, but I have to do this in typescript and react native.Getting api:import axios...
View ArticleReact Native Web typescript support
How can I make typescript work with react native web types.For example, in React Native, the component does not have onHoverIn, but it does exist in React Native Web. Is there any way to add these...
View Articletypescript for custom theme styled components
I have tried 2 different ways to do this based on some google searches.I'm trying to setup typing for a custom theme in typescript expo reactive native project.I've setup a declaration ts file and...
View Articlereact-native-swiper add child dynamically
I want to add dynamically component in <Swiper>?Like that:React.useEffect(()=>{ setDataArray([...data, newData]); // newData is just an example.},[index])return (<Swiper horizontal={true}...
View ArticleReact native debugger: "Error: ENOENT: no such file or directory"
Problem: When I run the remote debugger, metro server says it can't find this file.Error: ENOENT: no such file or directory, open...
View Articledifferent colors line chart with react native chart kit
I'm using react-native-chart-kit plugin and want to draw a line filled with green and red if goes outside of the blue zone, like in the picture. Can anyone say if it is possible and if so how can I...
View Articlehow to use react-native-root-toast as component in typescript
I am working on React Native project with Typescript, and want to create react-native-root-toast as a component, here's my component code:import React, { memo, useEffect, useState } from "react";import...
View ArticleHow to prevent component to re-render every time?
I have a custom component where I want to prevent the useEffect to fire every time the component is rendering.The main idea is to get the font-family name from the API and then pass it to the style...
View ArticleHow to specify (optional) default props with TypeScript for stateless,...
I'm trying to create a stateless React component with optional props and defaultProps in Typescript (for a React Native project). This is trivial with vanilla JS, but I'm stumped as to how to achieve...
View ArticleESLint (Airbnb) + Prettier setup for React Native (Expo) in TypeScript
I have been working on setting up linting & formatting for my React Native project for a couple of weeks now, but I'm unable to make much progress. I have looked at many tutorials and followed them...
View ArticleTypescript : import file with two different custom extensions
I have case where two files with same name but different custom extensions, for example in react native i have : CompA.android.tsx CompA.ios.tsxand i want to import like this import CompA from...
View ArticleHow can I import a file with two different custom extensions?
I have case where two files with same name but different custom extensions, for example in react native i have : CompA.android.tsx CompA.ios.tsxand i want to import like this import CompA from...
View ArticleReact Native cannot find name of Global Object?
I use the global variable in React Native, Eg: global.gScreen = { };When i use gScreen, eslint reports can not find name 'gScreen'.I have try this:In tsconfig.json add "node" to compilerOptions.types...
View ArticleReact Native array.length gives me 0 even when data is in array
I am having trouble with something that seems ridiculously simple and I can't believe I have had to result to this.I have an array messages: Message[] = [...] that I need to iterate through. However,...
View Article